Skip to content

ci: update eslint and prettier rules #31

ci: update eslint and prettier rules

ci: update eslint and prettier rules #31

name: Firebase Auto Deploy
on:
push:
branches:
- main
paths:
- 'src/**' # Changes to the source code
- 'public/**' # Changes to the public folder
- 'firebase.json' # Changes to the Firebase configuration
- 'package.json' # Changes to the package.json file
- 'index.html' # Changes to the index.html file
- 'vitest.config.js' # Changes to the Vitest configuration
- '.firebaserc' # Changes to the Firebase configuration
- '.github/workflows/*' # Changes to the workflow file
concurrency:
group: firebase-deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: πŸ§ͺ Test before Build
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout Code
uses: actions/checkout@v4
- name: πŸ› οΈ Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: πŸ“‚ Install Packages
run: npm ci
# 🚨 Run Lint check
- name: 🚨 Run Lint
run: npm run lint:fix | tee lint-results.txt
# 🎨 Run Prettier format check
- name: 🎨 Run Prettier
run: npm run format | tee prettier-results.txt
- name: πŸ§ͺ Run Tests with Vitest
run: npm run test:ci
deploy:
name: πŸš€ Deploy to Firebase
needs: build # Only run this job if the build job is successful
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout Code
uses: actions/checkout@v4
- name: πŸ› οΈ Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: πŸ“‚ Install Packages
run: npm ci
- name: 🧱 Build
run: npm run build
- name: 🌍 Install Firebase Tools
run: npm install -g firebase-tools
- name: πŸš€ Deploy to Firebase
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
run: firebase deploy --token "${{ secrets.FIREBASE_TOKEN }}" --non-interactive