From 9f8e03987353861ccc5e222d2f51a886b5053876 Mon Sep 17 00:00:00 2001 From: steveoh Date: Tue, 12 Dec 2023 17:39:51 -0700 Subject: [PATCH] ci: create job to deploy report pdf refs #273 --- .github/workflows/push.functions.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/push.functions.yml diff --git a/.github/workflows/push.functions.yml b/.github/workflows/push.functions.yml new file mode 100644 index 00000000..cdb0792c --- /dev/null +++ b/.github/workflows/push.functions.yml @@ -0,0 +1,50 @@ +name: Push Events (Functions) + +on: + push: + branches: + - main + - dev + paths: + - "src/functions/**" + - ".github/workflows/push.functions.yml" + +concurrency: + group: "${{ github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + deploy-dev: + name: Deploy to dev + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + environment: + name: dev + + steps: + - name: ⬇️ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - id: auth + name: 🗝️ Authenticate to Google Cloud + uses: google-github-actions/auth@v1 + with: + create_credentials_file: true + token_format: access_token + workload_identity_provider: ${{ secrets.IDENTITY_PROVIDER }} + service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }} + + - name: 🚀 Deploy Cloud Function + id: deploy + uses: google-github-actions/deploy-cloud-functions@v1 + with: + name: pdf + runtime: nodejs20 + source_dir: src/functions + service_account_email: cloud-function-sa@${{ secrets.PROJECT_ID }}.iam.gserviceaccount.com + https_trigger_security_level: "secure_always" + timeout: "2m"