-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (45 loc) · 1.58 KB
/
main.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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
strategy:
matrix:
include:
- org: Devfest Lille
secret: DEVFEST_FIREBASE_TOKEN
function: "functions:cms4devfestgdg"
target: "default"
front: "production"
config: "firebase.devfest.json"
- org: Cloud Nord
secret: CLOUDNORD_FIREBASE_TOKEN
function: "functions:cms4devfestcloudnord"
target: "cloudnord"
front: "production,cloudnord"
config: "firebase.cloudnord.json"
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
- name: Install Front
run: npm --prefix public install
- name: Build Back
run: npm --prefix functions install
- name: Deploy to Firebase for ${{ matrix.org }}
run: |
npm --prefix public run build -- --configuration ${{ matrix.front }}
npx firebase-tools deploy -c ${{matrix.config}} -P ${{ matrix.target }} --only hosting
npx firebase-tools deploy -c ${{matrix.config}} -P ${{ matrix.target }} --only firestore:rules
npx firebase-tools deploy -c ${{matrix.config}} -P ${{ matrix.target }} --only functions:cms
npx firebase-tools deploy -c ${{matrix.config}} -P ${{ matrix.target }} --only ${{ matrix.function }}
env:
FIREBASE_TOKEN: ${{ secrets[matrix.secret] }}