fix broken tests due to log args; add new test to new use -case #28
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
# Based on: https://github.com/GoogleCloudPlatform/github-actions/blob/master/example-workflows/cloud-run/.github/workflows/cloud-run.yml | |
name: deploy-api | |
defaults: | |
run: | |
working-directory: api | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PROJECT_ID: ${{ secrets.RUN_PROJECT }} | |
RUN_REGION: us-central1 | |
SERVICE_NAME: lastfm-last-played | |
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@v2 | |
- uses: 'google-github-actions/auth@v2' | |
with: | |
service_account_key: ${{ secrets.RUN_SA_KEY }} | |
project_id: ${{ secrets.RUN_PROJECT }} | |
- uses: google-github-actions/setup-gcloud@v2 | |
- name: Build | |
run: |- | |
gcloud builds submit \ | |
--quiet \ | |
--tag "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA" | |
- name: Deploy | |
run: |- | |
gcloud run deploy "$SERVICE_NAME" \ | |
--quiet \ | |
--region "$RUN_REGION" \ | |
--image "gcr.io/$PROJECT_ID/$SERVICE_NAME:$GITHUB_SHA" \ | |
--platform "managed" \ | |
--allow-unauthenticated |