Merge pull request #23 from gaveshalabs/dev #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |