Skip to content

Merge pull request #20 from weaponsforge/feat/weaponsforge-4 #2

Merge pull request #20 from weaponsforge/feat/weaponsforge-4

Merge pull request #20 from weaponsforge/feat/weaponsforge-4 #2

Workflow file for this run

name: Deploy to Development Environment
# /client app - deploy to Firebase Hosting
on:
push:
branches:
- dev
jobs:
lint-client:
name: Lint and Export client
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_PATH: ""
NEXT_PUBLIC_FIREBASE_WEB_API_KEY: ${{ secrets.DEV_FIREBASE_WEB_API_KEY }}
NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN: ${{ secrets.DEV_FIREBASE_WEB_AUTHDOMAIN }}
NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID: ${{ secrets.DEV_FIREBASE_WEB_PROJECT_ID }}
NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET: ${{ secrets.DEV_FIREBASE_WEB_STORAGE_BUCKET }}
NEXT_PUBLIC_FIREBASE_WEB_MESSAGING_SENDER_ID: ${{ secrets.DEV_FIREBASE_WEB_MESSAGING_SENDER_ID }}
NEXT_PUBLIC_FIREBASE_WEB_APP_ID: ${{ secrets.DEV_FIREBASE_WEB_APP_ID }}
NEXT_PUBLIC_FIREBASE_WEB_MEASUREMENT_ID: ${{ secrets.DEV_FIREBASE_WEB_MEASUREMENT_ID }}
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
ref: 'dev'
- name: Use NodeJS v20.15.0
uses: actions/setup-node@v3
with:
node-version: 20.15.0
- name: Install Dependencies
run: |
cd app
npm install
- name: Lint
run: |
cd app
npm run lint
- name: Export static files
run: |
cd app
npm run export
mv out/404/index.html out/404.html
- name: Prepare Firebase Deployment
run: |
cd app
sed -i -e "s/<FIREBASE_PROJECT_DEV>/${{ secrets.FIREBASE_PROJECT_DEV }}/g" .firebaserc
sed -i -e "s/<FIREBASE_PROJECT_DEV_HOSTING>/${{ secrets.FIREBASE_PROJECT_DEV_HOSTING }}/g" .firebaserc
- name: Archive Development Artifact
uses: actions/upload-artifact@v3
with:
name: dev-out
path: |
app/out
app/.firebaserc
app/firebase.json
retention-days: 3
deploy-client:
name: Deploy Client to Firebase Hosting
needs: lint-client
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: dev-out
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting:dev
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}