-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (84 loc) · 2.4 KB
/
deploy.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
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Deployment
on:
push:
branches:
- master
jobs:
test:
runs-on: macOS-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: "Init: Summon NodeJS"
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: "Init: Install yarn"
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash
- name: "Cache: node_modules"
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ env.cache-name }}-
${{ runner.OS }}-node-
- name: "Init: Install dependencies"
run: |
yarn install
cd ./functions
yarn install
cd ..
- name: "Test: Type checking"
run: |
yarn test:types
- name: "Test: Code linting"
run: |
yarn test:lint
deploy:
needs: test
runs-on: macOS-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: 'Init: Summon NodeJS'
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: "Cache: node_modules"
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ env.cache-name }}-
${{ runner.OS }}-node-
- name: 'Init: Install yarn'
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash
- name: 'Init: Install dependencies'
run: |
yarn install
cd ./functions
yarn install
cd ..
- name: "Build: Build firebase functions"
run: |
yarn build:functions
- name: "Build: Build static Next site"
env:
FULLSTORY: ${{ secrets.FULLSTORY }}
run: |
yarn build
yarn export
- name: "Deploy: Upload to Firebase"
env:
FIREBASE_DEPLOY_KEY: ${{ secrets.FIREBASE_DEPLOY_KEY }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
run: |
yarn firebase deploy -m "Automatic deployment from GitHub Actions" --non-interactive --token $FIREBASE_DEPLOY_KEY --project $FIREBASE_PROJECT_ID