forked from UN-SPIDER/burn-severity-mapping-EO
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 1.34 KB
/
build_and_deploy.yml
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
31
32
33
34
35
36
37
38
name: Push and Deploy to Cloud Run
on:
push:
branches:
- master
- dev
- dev-prod-split
jobs:
setup-build-deploy:
name: Setup, Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Setup Workload Identity Federation
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/113009620257/locations/global/workloadIdentityPools/github-actions/providers/oidc-provider"
project_id: "dse-nps"
service_account: "[email protected]"
- name: Set environment variable for branch name
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Build and Deploy
run: |
gcloud builds submit --config .deployment/cloudbuild.yml
if [ "${{ env.BRANCH_NAME }}" = "master" ]; then
gcloud beta run deploy tf-rest-burn-severity-prod --image us-central1-docker.pkg.dev/dse-nps/burn-backend/prod --platform managed --region us-central1
else
gcloud beta run deploy tf-rest-burn-severity-dev --image us-central1-docker.pkg.dev/dse-nps/burn-backend/dev --platform managed --region us-central1
fi