ci: update eslint and prettier rules #31
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: 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 |