-
Notifications
You must be signed in to change notification settings - Fork 14
57 lines (57 loc) · 1.82 KB
/
build.yml
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
name: Deploy to staging
on:
push:
branches:
- master
- staging/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install crcmod
run: |
sudo apt-get install gcc python3-dev python3-setuptools
sudo pip3 uninstall crcmod
sudo pip3 install --no-cache-dir -U crcmod
- name: Configure Git LFS to exclude tip sheet PDFs
run: |
git config --global lfs.fetchexclude "tip_sheets"
- name: Check out code
uses: actions/checkout@v3
with:
lfs: true
- name: Check out LFS objects
run: git lfs checkout
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Authenticate to Google Cloud
id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@v1
- name: Confirm gcloud setup
run: gcloud info
- name: Install project dependencies
run: npm install
- name: Build website
env:
# Default browser used by Puppeteer does not work
PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium-browser
run: npm run build
- name: Upload files to Google Cloud Storage (rsync)
id: upload-files
timeout-minutes: 15
run: |
gsutil -m rsync -d -R -c -x "assets/tip_sheets/.*$" ./dist/static gs://covid-website-storage2
gsutil web set -m index.html gs://covid-website-storage2/