fix: firebase hosting env, #48
Workflow file for this run
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: Development - Deploy to Firebase Hosting | |
# This workflow deploys the static-generated nextjs app to Firebase Hosting | |
# Triggered by push to the "dev" branch | |
on: | |
push: | |
branches: | |
- dev | |
- feat/weaponsforge-143 | |
jobs: | |
lint-export-client: | |
name: Lint and Export client | |
runs-on: ubuntu-latest | |
env: | |
NEXT_PUBLIC_BASE_PATH: '' | |
NEXT_PUBLIC_FIREBASE_WEB_API_KEY: ${{ secrets.FIREBASE_WEB_API_KEY_DEV }} | |
NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN: ${{ secrets.FIREBASE_WEB_AUTHDOMAIN_DEV }} | |
NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID: ${{ secrets.FIREBASE_WEB_PROJECT_ID_DEV }} | |
NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET: ${{ secrets.FIREBASE_WEB_STORAGE_BUCKET_DEV }} | |
FIREBASE_HOSTING_DEV: ${{ secrets.FIREBASE_HOSTING_DEV }} | |
FIREBASE_TARGET: 'dev' | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
with: | |
ref: 'feat/weaponsforge-143' | |
# ref: $FIREBASE_TARGET | |
- name: Build Firebase Settings | |
run: chmod u+x scripts/build.sh && ./scripts/build.sh | |
- name: Use NodeJS v16.14.2 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.14.2 | |
- name: Install Dependencies and lint | |
run: | | |
cd client | |
npm install | |
- name: Lint | |
run: | | |
cd client | |
npm run lint | |
- name: Export static files | |
run: | | |
cd client | |
npm run export | |
- name: Archive Development Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dev-app | |
include-hidden-files: true | |
path: | | |
client/out | |
client/firebase.json | |
client/.firebaserc | |
retention-days: 3 | |
# Deploy Firebase: Hosting, Firestore/Storage Rules and Indexes | |
deploy-firebase: | |
name: Deploy Client to Firebase Hosting | |
needs: lint-export-client | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: dev-app | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@master | |
with: | |
args: > | |
use $FIREBASE_TARGET && | |
deploy --only firestore:rules,firestore:indexes,storage,hosting:$FIREBASE_TARGET | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |