46 lines (44 loc) · 1.27 KB
/
push-main.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
name: Test and deploy productive version to firebase
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
- name: Install all packages
working-directory: ./sharetopia-frontend
run: npm ci
- name: Run unit tests
working-directory: ./sharetopia-frontend
run: npm run test:unit
build_and_deploy:
runs-on: ubuntu-latest
needs: test
name: build and deploy (productive)
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
- name: Install all packages
working-directory: ./sharetopia-frontend
run: npm ci
- name: build
working-directory: ./sharetopia-frontend
run: npm run build
# deploy to firebase
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_SHARETOPIA_F2810 }}'
channelId: live
projectId: sharetopia-f2810