-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (71 loc) · 2.1 KB
/
spotlight-staging.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Spotlight Staging Deploy
on:
push:
branches:
- main
paths:
- "spotlight-client/**"
defaults:
run:
working-directory: spotlight-client
jobs:
build:
name: Build frontend
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- uses: c-hive/gha-yarn-cache@v1
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
# in lieu of build-staging, which consumes a .env that is not available in CI,
# we configure the build for staging here
env:
REACT_APP_AUTH_ENABLED: true
REACT_APP_AUTH_ENV: development
REACT_APP_API_URL: ${{ secrets.REACT_APP_API_URL }}
REACT_APP_ENABLED_TENANTS: US_ID,US_ME,US_ND,US_PA,US_TN
run: yarn build
- name: Store build artifact
uses: actions/upload-artifact@v2
with:
name: build
path: spotlight-client/build
if-no-files-found: error
deploy:
name: Deploy frontend
needs: build
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v2
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: build
path: spotlight-client/build
- name: Wait on lint
uses: lewagon/wait-on-check-action@v0.2
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
check-name: Lint Spotlight Client
wait-interval: 10 # seconds
- name: Wait on tests
uses: lewagon/wait-on-check-action@v0.2
with:
ref: ${{ github.sha }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
check-name: Test Spotlight Client
wait-interval: 10 # seconds
- name: Deploy to Firebase
uses: w9jds/firebase-action@v2.0.0
env:
GCP_SA_KEY: ${{ secrets.FIREBASE_SERVICE_ACCT_KEY }}
PROJECT_PATH: ./spotlight-client
with:
args: deploy -P staging