Skip to content

Update README.md

Update README.md #44

Workflow file for this run

name: Google Cloud Run Revision Deploy
on:
pull_request:
push:
branches:
- main
# Kill the workflow if the PR is updated with a new commit
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-deploy:
name: Build and Deploy to Cloud Run
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
deployments: 'write'
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Get Environment
id: environment
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "::set-output name=name::production"
else
echo "::set-output name=name::development"
fi
- name: Create GitHub deployment
uses: chrnorm/deployment-action@v2
id: deployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: ${{ steps.environment.outputs.name }}
initial-status: in_progress
- name: Deploy to Cloud Run
uses: dmsi-io/gha-cloudrun-deploy@v1
id: deploy
with:
GCP_IDENTITY_PROVIDER: ${{ secrets.GCP_IDENTITY_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment-url: ${{ steps.deploy.outputs.url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'success'
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment-url: ${{ steps.deploy.outputs.url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'failure'