-
Notifications
You must be signed in to change notification settings - Fork 142
57 lines (55 loc) · 1.95 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
47
48
49
50
51
52
53
54
55
56
57
name: Deploy to Firebase
on:
push:
branches:
- master
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
MAIN_KEY: ${{ secrets.MAIN_KEY }}
MONGO_URI: ${{ secrets.MONGO_URI }}
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
SENDGRID_NEW_DEVELOPER_ACCOUNT_TEMPLATE: ${{ secrets.SENDGRID_NEW_DEVELOPER_ACCOUNT_TEMPLATE }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
REDIS_URL: ${{ secrets.REDIS_URL }}
GITHUB_STATS_TOKEN: ${{ secrets.GITHUB_STATS_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
NODE_ENV: production
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2.1.2
with:
node-version: '18'
- name: Install Project Dependencies
run: |
rm -rf ./node_modules; yarn install
npm install -g firebase-tools
- name: Install Cloud Dependencies
run: |
cd functions; rm -rf ./node_modules/; yarn; cd ..; pwd
firebase use default --token $FIREBASE_TOKEN
- name: Migrate MongoDB Data
run: |
firebase functions:config:set env.redis_status=true runtime.env=production --token $FIREBASE_TOKEN
yarn migrate-up
- name: Build Production Project
run: |
firebase functions:config:set runtime.env=production --token $FIREBASE_TOKEN
yarn build
- name: Deploy to prod
uses: docker://w9jds/firebase-action:master
with:
args: deploy --project=igbo-api-bb22d --only functions,hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}