forked from mozilla/extension-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.56 KB
/
gcp_deploy_prod.yaml
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
name: Deploy to GCS Prod
on:
push:
tags:
- "20*"
workflow_dispatch:
jobs:
test-website:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install dependencies
run: yarn install --immutable
- name: Test current build
run: yarn run test-ci
continue-on-error: true
deploy-prod:
runs-on: ubuntu-latest
needs: test-website
if: ${{ success() }}
environment: prod
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Set up Google Cloud SDK
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v2
- name: Build the website
run: |
yarn install --immutable
yarn build:production
- name: Build version.json file
run: |
if [ -e version.json ]; then
echo "version.json exists, skipping build"
else
echo "version.json does not exist, running build-version-json.sh"
bash ./.utils/build-version-json.sh
fi
- name: Deploy website to prod
run: |
sh ./.utils/gcs-deploy.sh ${{ vars.EXTENSIONWORKSHOP_BUCKET_PROD }}