Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting up dev env for admin #296

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
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": {}
}
26 changes: 22 additions & 4 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
name: Deploy to Firebase Hosting on merge
'on':
push:
branches:
- main
branches: [main, dev, bywang/dev-env]
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 +11 to +21
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 +32,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