-
Notifications
You must be signed in to change notification settings - Fork 11
77 lines (66 loc) · 2.06 KB
/
Copy pathdeploy-stage-api.yml
File metadata and controls
77 lines (66 loc) · 2.06 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
71
72
73
74
75
76
77
name: Stage Build - API
on:
push:
branches:
- main
workflow_dispatch:
inputs:
notes:
description: "Notes"
required: false
default: ""
workflow_call:
secrets:
GCP_PROJECT_NAME:
required: true
WIP_PROJECT_ID:
required: true
repository_dispatch:
types: [bcd_release]
# No GITHUB_TOKEN permissions, as we don't use it.
permissions: {}
concurrency:
group: ${{ github.workflow }}
jobs:
deploy-stage-api:
name: Deploy to stage
runs-on: ubuntu-latest
environment: stage
permissions:
contents: read
id-token: write
defaults:
run:
working-directory: api
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: .nvmrc
package-manager-cache: false
registry-url: "https://registry.npmjs.org/"
- run: npm ci
- name: Update BCD package
run: |-
npm update @mdn/browser-compat-data
npm list @mdn/browser-compat-data
- run: npm run generate
- name: Authenticate with GCP
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
with:
token_format: access_token
service_account: deploy-stage-bcd@${{ secrets.GCP_PROJECT_NAME }}.iam.gserviceaccount.com
workload_identity_provider: projects/${{ secrets.WIP_PROJECT_ID }}/locations/global/workloadIdentityPools/github-actions/providers/github-actions
- name: Upload to GCS
uses: google-github-actions/upload-cloud-storage@6397bd7208e18d13ba2619ee21b9873edc94427a # v3.0.0
with:
path: api/out/v0/current
destination: bcd-stage-mdn/bcd/api/v0/current
resumable: false
headers: |-
cache-control: public, max-age=3600
parent: false
concurrency: 500
process_gcloudignore: false