-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (28 loc) · 1.03 KB
/
firebase-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
name: Deploy Angular frontend to Firebase
on:
push:
branches:
- main
- dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies.
run: npm install
- name: Set firebase project.
id: set-firebase-project
run: echo "FIREBASE_PROJECT=$(if [ ${{ github.ref }} == 'refs/heads/main' ]; then echo 'prod'; else echo 'dev'; fi)" >> $GITHUB_ENV
- name: Build Angular app.
run: npx ng build --configuration=${{ env.FIREBASE_PROJECT }}
- name: Deploy to firebase hosting.
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting --project ${{ env.FIREBASE_PROJECT }}
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}