-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.63 KB
/
Copy pathdeploy.yml
File metadata and controls
47 lines (40 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy to Cloud Run
on:
push:
branches: [master, main]
# Manual trigger so we can force a fresh Cloud Build rebuild without a code change
# (a Cloud Build layer-cache miss can silently ship a stale bundle — see hotfix commit).
workflow_dispatch: {}
jobs:
deploy:
runs-on: ubuntu-latest
needs: [] # runs independently; CI tests run in ci.yml on the same trigger
timeout-minutes: 15
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
# The viewer's Dockerfile lives at packages/viewer/Dockerfile but COPYs the lockfile and every
# workspace package.json from the REPO ROOT, so the build context must be the root with the
# Dockerfile alongside it. Without a root Dockerfile, `--source .` falls back to buildpacks,
# which run `npm ci` on the monorepo root and fail.
- name: Stage Dockerfile at build root
run: |
cp packages/viewer/Dockerfile ./Dockerfile
printf 'node_modules/\n**/dist/\n.git/\n.github/\n.claude/\n' > .gcloudignore
- name: Deploy to Cloud Run
run: |
gcloud run deploy termchart-viewer \
--source . \
--region ${{ vars.GCP_REGION }} \
--project ${{ vars.GCP_PROJECT }} \
--memory 1Gi \
--quiet