Skip to content

Deploy Cloud Functions #256

Deploy Cloud Functions

Deploy Cloud Functions #256

Workflow file for this run

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: python311
permissions:
contents: read
id-token: write
env:
MYPY_VERSION: ${{ github.event.inputs.mypy_version || 'master' }}
RUNTIME: ${{ github.event.inputs.runtime || 'python311' }}
jobs:
gcp-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Add mask
run: echo "::add-mask::${{ secrets.GCP_PROJECT }}"
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v1
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@v1
- 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 }}