forked from netlight/my-finance-pal-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (25 loc) · 897 Bytes
/
cd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: CD
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
steps:
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Deploy app to Cloud Run
run: |
gcloud run deploy my-finance-pal \
--image ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/cloud-run-builds/my-finance-pal:${{ github.sha }} \
--allow-unauthenticated \
--region ${{ secrets.GCP_REGION }}