File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow build and push a Docker container to Google Artifact Registry
2
+ # and deploy it on Cloud Run when a commit is pushed to the "main" branch.
3
+
4
+ name : ' Build and Deploy to App Engine'
5
+
6
+ on :
7
+ push :
8
+ branches :
9
+ - main
10
+
11
+ env :
12
+ PROJECT_ID : ' ${{ secrets.PROJECT_ID }}'
13
+ REGION : ' ${{ secrets.REGION }}'
14
+ SERVICE : ' ${{ secrets.SERVICE }}'
15
+
16
+ jobs :
17
+ deploy :
18
+ runs-on : ' ubuntu-latest'
19
+
20
+ permissions :
21
+ contents : ' read'
22
+ id-token : ' write'
23
+
24
+ steps :
25
+ - name : ' Checkout'
26
+ uses : ' actions/checkout@v4'
27
+
28
+ - name : ' Authenticate to Google Cloud'
29
+ uses : ' google-github-actions/auth@v2'
30
+ with :
31
+ credentials_json : ' ${{ secrets.GCP_SA_KEY }}'
32
+
33
+ # - name: 'Docker Auth'
34
+ # run: |-
35
+ # gcloud auth configure-docker "${{ env.REGION }}-docker.pkg.dev"
36
+
37
+ # - name: 'Build and Push Container'
38
+ # run: |-
39
+ # IMAGE="${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.GAR_NAME }}/${{ env.SERVICE }}:${{ github.sha }}"
40
+ # docker build --tag "${IMAGE}" .
41
+ # docker push "${IMAGE}"
42
+
43
+ - name : ' Deploy to App Engine'
44
+ run : |
45
+ gcloud app deploy --quite
46
+
47
+
You can’t perform that action at this time.
0 commit comments