-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 1.91 KB
/
ci.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
name: CI
'on':
push:
schedule:
- cron: "0 7 * * *"
jobs:
test:
name: Lint & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: '${{ runner.os }}-node-${{ hashFiles(''**/package-lock.json'') }}'
- name: Install dependencies
run: npm ci && cd functions && npm ci && cd ..
- name: Lint
run: npm run lint
- name: Test
run: npm run test
deployFrontend:
name: Deploy Frontend
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: '${{ runner.os }}-node-${{ hashFiles(''**/package-lock.json'') }}'
- name: Install dependencies
run: npm ci && cd functions && npm ci && cd ..
- name: Build Project for Production
run: npm run build
env:
BASE: '/'
BASE_URL: 'https://adrianjost.dev'
- name: Deploy to Firebase
run: npx -p firebase-tools firebase deploy --only hosting --token $FIREBASE_TOKEN
env:
FIREBASE_TOKEN: '${{ secrets.FIREBASE_TOKEN }}'
deployBackend:
name: Deploy Backend
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: '${{ runner.os }}-node-${{ hashFiles(''**/package-lock.json'') }}'
- name: Install dependencies
run: npm ci && cd functions && npm ci && cd ..
- name: Deploy to Firebase
run: npx -p firebase-tools firebase deploy --only functions --token $FIREBASE_TOKEN
env:
FIREBASE_TOKEN: '${{ secrets.FIREBASE_TOKEN }}'