Skip to content

improve

improve #221

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
# https://www.youtube.com/watch?v=kLEp5tGDqcI
# https://docs.github.com/en/actions/learn-github-actions/environment-variables
name: Firebase CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install and ci and build
env:
REACT_APP_LOGTAIL_WEBSITE_KEY: ${{ secrets.LOGTAIL_WEBSITE_KEY }}
REACT_APP_FIREBASE_WEBSITE_APIKEY: ${{ secrets.FIREBASE_WEBSITE_APIKEY }}
REACT_APP_FIREBASE_WEBSITE_AUTHDOMAIN: ${{ secrets.FIREBASE_WEBSITE_AUTHDOMAIN }}
REACT_APP_FIREBASE_WEBSITE_PROJECTID: ${{ secrets.FIREBASE_WEBSITE_PROJECTID }}
REACT_APP_FIREBASE_WEBSITE_STORAGEBUCKET: ${{ secrets.FIREBASE_WEBSITE_STORAGEBUCKET }}
REACT_APP_FIREBASE_WEBSITE_MESSAGINGSENDERID: ${{ secrets.FIREBASE_WEBSITE_MESSAGINGSENDERID }}
REACT_APP_FIREBASE_WEBSITE_APPID: ${{ secrets.FIREBASE_WEBSITE_APPID }}
REACT_APP_FIREBASE_WEBSITE_MEASUREMENTID: ${{ secrets.FIREBASE_WEBSITE_MEASUREMENTID }}
run: |
git submodule update --init --recursive
npm install
npm ci
npm run build
- name: Archive Build
uses: actions/upload-artifact@v3
with:
name: build
path: build
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Build
uses: actions/download-artifact@v3
with:
name: build
path: build
# https://github.com/FirebaseExtended/action-hosting-deploy
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DRINCS_WEBSITE }}'
projectId: drincs-website
channelId: live # prod