Repository navigation
70 lines (57 loc) · 2.26 KB
/
Copy pathstencilbook.yml
File metadata and controls
70 lines (57 loc) · 2.26 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Stencilbook
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
# not sure why this was needed, commenting out to see if anything breaks
# env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
deploy:
name: Deploy to static site bucket
runs-on: ubuntu-latest
if: ${{ github.event_name != 'push' || matrix.package != 'mint-components' }}
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
package:
- mint-components
- bedrock-components
- paypal-components
steps:
- name: Checkout
id: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 3d3c4 = v7.0.1
- name: Node Setup
id: setup-node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # 82076 = v7.0.0
with:
node-version: 22.x
- name: Install npm dependencies
id: install-deps
run: cd packages/${{ matrix.package }} && npm ci
- name: Build
id: build
run: cd packages/${{ matrix.package }} && NODE_ENV=dev npm run build
- name: Authenticate with Google Cloud
id: auth
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # 7c6bc = v3
with:
token_format: "access_token"
workload_identity_provider: "projects/167728399658/locations/global/workloadIdentityPools/github/providers/github"
service_account: "github-static-site-actions@static-site-proxy.iam.gserviceaccount.com"
- name: Setup GCP
id: setup-gcp
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # aa548 = v3.0.1
- name: Deploy to bucket (pull request)
id: deploy-to-bucket-pr
if: ${{ github.event_name == 'pull_request' }}
run: gsutil -m rsync -d -r packages/${{ matrix.package }}/www/ gs://stencilbook_static_saasquatch/${{ matrix.package }}/pr${{ github.event.number }}/
- name: Deploy to bucket (push)
id: deploy-to-bucket-push
if: ${{ github.event_name == 'push' }}
run: gsutil -m rsync -d -r packages/${{ matrix.package }}/www/ gs://stencilbook_static_saasquatch/${{ matrix.package }}/production/