update path #11
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: Build / Test / Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
PROJECT_ID: my-project # TODO: update to your Google Cloud project ID | |
REGION: us-central1 # TODO: update to your region | |
SERVICE: my-service # TODO: update to your service name | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Lint & Build | |
working-directory: ./app | |
run: npm ci && npm run lint && npm run build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./app/out | |
Deploy: | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-latest | |
needs: Build | |
environment: Development | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download artefacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: build-artifacts | |
- name: 'Authenticate' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
project_id: ${{ secrets.GCP_BUCKET }} | |
workload_identity_provider: ${{ secrets.GCP_WIP }} | |
- name: Cloud Storage Uploader | |
uses: google-github-actions/upload-cloud-storage@v2 | |
with: | |
path: 'build-artifacts' | |
destination: ${{ secrets.GCP_BUCKET }} | |
parent: false | |