use env for job #3
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 to Google Cloud Functions | |
on: | |
push: | |
branches: | |
- main # or your default branch | |
workflow_dispatch: # allows manual triggers | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: cicd | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '>=22.0.0' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- id: 'auth' | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
project_id: ${{ vars.GCP_PROJECT_ID }} | |
- name: Setup Google Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
with: | |
project_id: ${{ vars.GCP_PROJECT_ID }} | |
- name: Deploy to Cloud Run Functions | |
run: | | |
just deploy |