Update main.yml #3
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 to Cloud Run from Source' | ||
on: | ||
push: | ||
branches: [master] | ||
env: | ||
PROJECT_ID: ${{ vars.PROJECT_ID }} | ||
REGION: 'us-east1' # TODO: update to your region | ||
jobs: | ||
deploy: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: 'Checkout' | ||
uses: 'actions/checkout@v4 | ||
- id: 'auth' | ||
name: 'Authenticate to Google Cloud' | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
workload_identity_provider: 'projects/${{ secrets.PROJECT_ID }}/locations/global/workloadIdentityPools/github-actions-pool/providers/github-actions-oidc' | ||
- name: 'Deploy to Cloud Run' | ||
run: | | ||
gcloud run jobs deploy fantasy-football-chat-bot \ | ||
--source . \ | ||
--region us-east1 | ||
--project ${{ secrets.PROJECT_ID }} | ||
# If required, use the Cloud Run URL output in later steps | ||
- name: 'Show output' | ||
run: |- | ||
echo ${{ steps.deploy.outputs.url }} |