-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (72 loc) · 2.27 KB
/
deploy-dev.yml
File metadata and controls
85 lines (72 loc) · 2.27 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Deploy to Development
permissions:
contents: read
on:
push:
branches:
- develop
paths:
- 'functions/**'
- '.github/workflows/deploy-dev.yml'
workflow_dispatch:
jobs:
test:
name: Test Functions
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './functions/package-lock.json'
- name: Install dependencies
run: npm ci
working-directory: ./functions
- name: Decode and create .env file
run: echo "${{ secrets.ENV_BASE64 }}" | base64 --decode > .env
working-directory: ./functions
- name: Validate code
run: npm run validate
working-directory: ./functions
- name: Upload test coverage
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./functions/coverage/
retention-days: 14
if: success()
deploy-dev:
name: Deploy Development Function
needs: test
runs-on: ubuntu-latest
environment: DEV
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './functions/package-lock.json'
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Install dependencies
run: npm ci
working-directory: ./functions
- name: Deploy to Firebase
env:
CLIENT_AUTH_API_KEY: ${{ secrets.CLIENT_AUTH_API_KEY }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
MAILJET_PUBLIC_KEY: ${{ secrets.MAILJET_PUBLIC_KEY }}
MAILJET_PRIVATE_KEY: ${{ secrets.MAILJET_PRIVATE_KEY }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
run: |
firebase deploy --only functions:apiDev
working-directory: ./functions