Deploy Cloud Functions #773
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 Cloud Functions | |
on: | |
schedule: | |
# 00:00 (UTC) | |
- cron: "00 00 * * *" | |
workflow_dispatch: | |
inputs: | |
mypy_version: | |
description: mypy version | |
required: true | |
type: string | |
default: master | |
runtime: | |
description: Runtime version | |
required: true | |
type: string | |
default: python312 | |
permissions: | |
contents: read | |
id-token: write | |
env: | |
MYPY_VERSION: ${{ github.event.inputs.mypy_version || 'master' }} | |
RUNTIME: ${{ github.event.inputs.runtime || 'python312' }} | |
jobs: | |
gcp-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add mask | |
run: echo "::add-mask::${{ secrets.GCP_PROJECT }}" | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Use gcloud CLI | |
run: gcloud info | |
- name: Deploy Cloud Function | |
run: ./deploy.sh ${{ env.MYPY_VERSION }} | |
working-directory: ./sandbox/cloud_functions | |
env: | |
REGION: ${{ secrets.GCP_REGION }} | |
RUNTIME: ${{ env.RUNTIME }} | |
INVOKER_MEMBER: ${{ secrets.GCP_INVOKER_MEMBER }} | |
SERVICE_ACCOUNT: ${{ secrets.GCP_FUNCTION_SERVICE_ACCOUNT }} |