Skip to content

Bump @google-cloud/storage from 7.7.0 to 7.8.0 in /google/cloud-funct… #20

Bump @google-cloud/storage from 7.7.0 to 7.8.0 in /google/cloud-funct…

Bump @google-cloud/storage from 7.7.0 to 7.8.0 in /google/cloud-funct… #20

name: Deploy Google Cloud Function
on:
push:
branches: [main]
paths:
- "google/**"
workflow_dispatch:
jobs:
ci:
name: CI
uses: "./.github/workflows/ci.yml"
deploy:
name: Deploy
permissions:
contents: read
id-token: write
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
- uses: google-github-actions/setup-gcloud@v2
with:
version: ">= 363.0.0"
- name: Deploy 2nd generation Cloud Function
id: deploy
run: |
gcloud functions deploy nodejs-http-trigger \
--region=us-central1 \
--entry-point=transformImage \
--gen2 \
--memory=1GiB \
--runtime=nodejs20 \
--source=. \
--timeout=30 \
--set-env-vars=GCP_BUCKET_NAME=${{ secrets.GCP_BUCKET_NAME }} \
--max-instances=100 \
--trigger-http
echo "uri=$(gcloud functions describe nodejs-http-trigger --gen2 --project=${{ secrets.GCP_PROJECT_ID }} --region=us-central1 --format="value(serviceConfig.uri)")" >> $GITHUB_OUTPUT
working-directory: "./google/cloud-functions/transform-image"
- name: Test deployed Cloud Function
run: |
wget --post-data "width=800&height=600" --quiet --server-response --output-document - ${{ steps.deploy.outputs.uri }} 2>&1 | grep "content-type: image/jpeg"