Skip to content

Commit 1ae6c1b

Browse files
committed
adding schedule to regularly rebuild the container once a week
1 parent 4b76bf7 commit 1ae6c1b

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
schedule:
8+
- cron: "0 0 * * 0"
79

810
env:
911
SERVICE_NAME: sigconverter
@@ -14,23 +16,23 @@ jobs:
1416
runs-on: ubuntu-latest
1517

1618
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
19+
- name: Checkout code
20+
uses: actions/checkout@v3
1921

20-
- name: Setup Google Cloud SDK
21-
uses: google-github-actions/[email protected]
22-
with:
23-
project_id: ${{ secrets.PROJECT_ID }}
24-
service_account_key: ${{ secrets.GCLOUD_AUTH }}
22+
- name: Setup Google Cloud SDK
23+
uses: google-github-actions/[email protected]
24+
with:
25+
project_id: ${{ secrets.PROJECT_ID }}
26+
service_account_key: ${{ secrets.GCLOUD_AUTH }}
2527

26-
- name: Configure Docker
27-
run: gcloud auth configure-docker
28+
- name: Configure Docker
29+
run: gcloud auth configure-docker
2830

29-
- name: Build Docker image
30-
run: docker build -t ${{ env.IMAGE_NAME }} .
31+
- name: Build Docker image
32+
run: docker build -t ${{ env.IMAGE_NAME }} .
3133

32-
- name: Push Docker image to Google Container Registry
33-
run: gcloud builds submit --tag gcr.io/${{ secrets.PROJECT_ID }}/${{ env.IMAGE_NAME }}
34+
- name: Push Docker image to Google Container Registry
35+
run: gcloud builds submit --tag gcr.io/${{ secrets.PROJECT_ID }}/${{ env.IMAGE_NAME }}
3436

35-
- name: Deploy to Google Cloud Run
36-
run: gcloud run deploy ${{ env.SERVICE_NAME }} --image gcr.io/${{ secrets.PROJECT_ID }}/${{ env.IMAGE_NAME }} --platform managed --region us-central1
37+
- name: Deploy to Google Cloud Run
38+
run: gcloud run deploy ${{ env.SERVICE_NAME }} --image gcr.io/${{ secrets.PROJECT_ID }}/${{ env.IMAGE_NAME }} --platform managed --region us-central1

0 commit comments

Comments
 (0)