deploy #6
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: 'deploy' | |
on: | |
workflow_run: | |
workflows: [scout] | |
types: | |
- completed | |
env: | |
PROJECT_ID: '${{ secrets.GOOGLE_CLOUD_PROJECT_ID }}' # TODO: update to your Google Cloud project ID | |
REGION: 'us-central1' # TODO: update to your region | |
SERVICE: 'todo-demo-app' # TODO: update to your service name | |
jobs: | |
deploy: | |
runs-on: 'ubuntu-latest' | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v4' # actions/checkout@v4 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v2' # google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
- name: 'Deploy to Cloud Run' | |
uses: 'google-github-actions/deploy-cloudrun@v2' | |
with: | |
service: '${{ env.SERVICE }}' | |
region: '${{ env.REGION }}' | |
# NOTE: If using a pre-built image, update the image name below: | |
image: 'docker.io/olegselajev241/todo-demo-application:latest' | |
# If required, use the Cloud Run URL output in later steps | |
- name: 'Show output' | |
run: |2- | |
echo ${{ steps.deploy.outputs.url }} |