Skip to content
Merged
13 changes: 11 additions & 2 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"projects": {
"default": "nwplus-ubc"
"default": "nwplus-ubc",
"dev": "nwplus-ubc-dev"
},
"targets": {
"nwplus-ubc": {
Expand All @@ -9,6 +10,14 @@
"nw-admin-portal"
]
}
},
"nwplus-ubc-dev": {
"hosting": {
"admin-portal": [
"dev-nwplus-admin"
]
}
}
}
},
"etags": {}
}
27 changes: 23 additions & 4 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
branches: [main, dev]
workflow_dispatch:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
env:
IS_PRODUCTION: ${{ endsWith(github.ref, 'main') }}
NODE_OPTIONS: --openssl-legacy-provider
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: '18.x'
- name: Set up Firebase CLI
run: yarn global add firebase-tools
Comment on lines +12 to +22
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referenced how we did it in portal

  • node v 16 is not compatible so upgraded to 18

- name: Install and Build
run: yarn install --frozen-lockfile && yarn build
env:
Expand All @@ -28,7 +33,21 @@ jobs:
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
SERVICE_ACCOUNT_TOKEN: ${{ secrets.SERVICE_ACCOUNT_TOKEN }}
FIREBASE_CLI_PREVIEWS: hostingchannels
- uses: FirebaseExtended/action-hosting-deploy@v0
# - name: Deploy to dev firebase project
# if: ${{ env.IS_PRODUCTION == 'false' }}
# run: firebase deploy --only hosting:admin-portal --project nwplus-ubc-dev --non-interactive --token ${{ secrets.FIREBASE_TOKEN }}
- name: Deploy to dev firebase project
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NWPLUS_UBC_DEV }}'
projectId: nwplus-ubc-dev
target: admin-portal
channelId: live
firebaseToolsVersion: 12.9.1
- name: Deploy to prod firebase project
if: ${{ env.IS_PRODUCTION == 'true' }}
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_NWPLUS_UBC }}'
Expand Down
Loading