-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.85 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
# CD script to deploy project to Firebase on push to main branch
name: Firebase Continuous Deployment
on:
push:
branches: [ main ]
jobs:
deploy:
# Ubuntu is cheaper to use than Windows or macOS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 10
- name: Create frontend environment file
run: |
touch .env
echo REACT_APP_FIREBASE_API_KEY=${{ secrets.REACT_APP_FIREBASE_API_KEY }} >> .env
echo REACT_APP_FIREBASE_AUTH_DOMAIN=${{ secrets.REACT_APP_FIREBASE_AUTH_DOMAIN }} >> .env
echo REACT_APP_FIREBASE_DATABASE_URL=${{ secrets.REACT_APP_FIREBASE_DATABASE_URL }} >> .env
echo REACT_APP_FIREBASE_PROJECT_ID=${{ secrets.REACT_APP_FIREBASE_PROJECT_ID }} >> .env
echo REACT_APP_FIREBASE_STORAGE_BUCKET=${{ secrets.REACT_APP_FIREBASE_STORAGE_BUCKET }} >> .env
echo REACT_APP_FIREBASE_MESSAGING_SENDER_ID=${{ secrets.REACT_APP_FIREBASE_MESSAGING_SENDER_ID }} >> .env
echo REACT_APP_FIREBASE_APP_ID=${{ secrets.REACT_APP_FIREBASE_APP_ID }} >> .env
echo REACT_APP_FIREBASE_MEASUREMENT_ID=${{ secrets.REACT_APP_FIREBASE_MEASUREMENT_ID }} >> .env
echo REACT_APP_HERE_API_KEY=${{ secrets.REACT_APP_HERE_API_KEY }} >> .env
echo REACT_APP_PURPLEAIR_READ_API_KEY=${{ secrets.PURPLEAIR_READ_API_KEY }} >> .env
echo REACT_APP_PURPLEAIR_WRITE_API_KEY=${{ secrets.PURPLEAIR_WRITE_API_KEY }} >> .env
- name: Install dependencies
run: |
npm ci
cd functions
npm ci
- name: Build project
run: |
npm run build
cd functions
npm run build
# Existing Action that acts as library for Firebase
- uses: w9jds/firebase-action@master
with:
args: deploy
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}