-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (46 loc) · 1.93 KB
/
build-and-deploy-on-merge.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
name: Build and deploy on dev
on:
push:
branches:
- main
jobs:
build-and-deploy-dev:
runs-on: ubuntu-latest
environment: dev
steps:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Checkout merged code
uses: actions/checkout@v2
- name: Retrieve npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Bootstrap
run: npm run bootstrap
- name: Build project
run: npm run build
env:
REACT_APP_FIREBASE_CONFIG_API_KEY: ${{ secrets.REACT_APP_FIREBASE_CONFIG_API_KEY }}
REACT_APP_FIREBASE_CONFIG_AUTH_DOMAIN: ${{ secrets.REACT_APP_FIREBASE_CONFIG_AUTH_DOMAIN }}
REACT_APP_FIREBASE_CONFIG_DATABASE_URL: ${{ secrets.REACT_APP_FIREBASE_CONFIG_DATABASE_URL }}
REACT_APP_FIREBASE_CONFIG_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_PROJECT_ID }}
REACT_APP_FIREBASE_CONFIG_STORAGE_BUCKET: ${{ secrets.REACT_APP_FIREBASE_CONFIG_STORAGE_BUCKET }}
REACT_APP_FIREBASE_CONFIG_MESSAGING_SENDER_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_MESSAGING_SENDER_ID }}
REACT_APP_FIREBASE_CONFIG_APP_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_APP_ID }}
REACT_APP_ENV: dev
- name: Setup database target
run: npm run scripts:deploy-database-instances-rules
env:
FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_PROJECT_ID }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
- name: Deploy
run: npx firebase deploy --project $FIREBASE_PROJECT_ID --token "$FIREBASE_TOKEN" --force
env:
FIREBASE_PROJECT_ID: ${{ secrets.REACT_APP_FIREBASE_CONFIG_PROJECT_ID }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}