-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.16 KB
/
prod-deploy-frontend.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
name: Deploy frontend on push/merge
on:
push:
branches:
- main
paths:
- '*.json'
- '*.js'
- 'src/**'
- '.github/workflows/prod-deploy-frontend.yml'
jobs:
# Build the frontend giles
build:
name: Compile frontend
runs-on: ubuntu-latest
steps:
# Environment and dependency setup
- name: Cloning repository
uses: actions/checkout@v1
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Set Node.js (.nvmrc)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Install dependencies
run: npm i
- name: Create environment files
run: |
echo -e "${{ secrets.DOTENV_PRODUCTION }}" > .env
# Deployment
- name: Build website files
env:
NODE_ENV: production
run: npm run build
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting,firestore --project=production
env:
GCP_SA_KEY: ${{ secrets.SERVICE_ACCOUNT_PRODUCTION }}