change endpoint url for dev deployments to reflect change #221
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push and Deploy to Cloud Run | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
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-prod/providers/oidc-provider-prod" | |
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 - Burn Backend | |
run: | | |
if [ "${{ env.BRANCH_NAME }}" = "master" ]; then | |
gcloud builds submit --config .deployment/burn_backend/prod_cloudbuild.yml | |
gcloud beta run deploy tf-rest-burn-backend-prod --image us-central1-docker.pkg.dev/dse-nps/burn-backend-prod/prod --platform managed --region us-central1 | |
else | |
gcloud builds submit --config .deployment/burn_backend/dev_cloudbuild.yml | |
gcloud beta run deploy tf-rest-burn-backend-dev --image us-central1-docker.pkg.dev/dse-nps/burn-backend-dev/dev --platform managed --region us-central1 | |
fi | |
- name: Build and Deploy - Titiler | |
run: | | |
if [ "${{ env.BRANCH_NAME }}" = "master" ]; then | |
gcloud builds submit --config .deployment/titiler/prod_cloudbuild.yml | |
gcloud beta run deploy tf-titiler-prod --image us-central1-docker.pkg.dev/dse-nps/titiler-prod/prod --platform managed --region us-central1 | |
else | |
gcloud builds submit --config .deployment/titiler/dev_cloudbuild.yml | |
gcloud beta run deploy tf-titiler-dev --image us-central1-docker.pkg.dev/dse-nps/titiler-dev/dev --platform managed --region us-central1 | |
fi |