Merge pull request #584 from nwplus/ios-fix #311
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
# This file was auto-generated by the Firebase CLI | |
# https://github.com/firebase/firebase-tools | |
name: Deploy to Firebase Hosting on merge | |
on: | |
push: | |
branches: [main, dev] | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
env: | |
IS_PRODUCTION: ${{ endsWith(github.ref, 'main') }} | |
steps: | |
- uses: actions/checkout@master | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Set up firebase | |
run: sudo npm install -g [email protected] --unsafe | |
- name: Choose dev firebase project | |
if: ${{ env.IS_PRODUCTION == 'false' }} | |
run: firebase use nwplus-ubc-dev --token ${{ secrets.FIREBASE_TOKEN }} | |
- name: Choose prod firebase project | |
if: ${{ env.IS_PRODUCTION == 'true' }} | |
run: firebase use nwplus-ubc --token ${{ secrets.FIREBASE_TOKEN }} | |
- name: Install dependencies | |
run: npm install --force | |
- name: Build with dev env variables | |
if: ${{ env.IS_PRODUCTION == 'false' }} | |
run: npm run build:staging | |
env: | |
REACT_APP_FIREBASE_API_KEY: ${{ secrets.DEV_FIREBASE_API_KEY }} | |
REACT_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.DEV_FIREBASE_AUTH_DOMAIN }} | |
REACT_APP_FIREBASE_DATABASE_URL: ${{ secrets.DEV_FIREBASE_DATABASE_URL }} | |
REACT_APP_FIREBASE_PROJECT_ID: ${{ secrets.DEV_FIREBASE_PROJECT_ID }} | |
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.DEV_FIREBASE_STORAGE_BUCKET }} | |
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.DEV_FIREBASE_MESSAGING_SENDER_ID }} | |
REACT_APP_FIREBASE_APP_ID: ${{ secrets.DEV_FIREBASE_APP_ID }} | |
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.DEV_FIREBASE_MEASUREMENT_ID }} | |
- name: Build with prod env variables | |
if: ${{ env.IS_PRODUCTION == 'true' }} | |
env: | |
REACT_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} | |
REACT_APP_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }} | |
REACT_APP_FIREBASE_DATABASE_URL: ${{ secrets.FIREBASE_DATABASE_URL }} | |
REACT_APP_FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }} | |
REACT_APP_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }} | |
REACT_APP_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }} | |
REACT_APP_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} | |
REACT_APP_FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MEASUREMENT_ID }} | |
run: npm run build | |
- name: Deploy to dev firebase project | |
if: ${{ env.IS_PRODUCTION == 'false' }} | |
run: firebase deploy --only hosting:nwplus-ubc-dev --non-interactive --token ${{ secrets.FIREBASE_TOKEN }} | |
- name: Choose prod firebase project | |
if: ${{ env.IS_PRODUCTION == 'true' }} | |
run: firebase deploy --only hosting:nwplus-ubc --non-interactive --token ${{ secrets.FIREBASE_TOKEN }} |