Update package.json and README.md #34
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: Build and Test | |
on: | |
push: | |
branches: | |
- production | |
pull_request: | |
branches: | |
- production | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Set up Git and update production branch | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
git checkout production | |
git fetch | |
git pull --no-rebase | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build (Vite) | |
run: yarn build | |
- name: Test (Vitest) | |
run: yarn test | |
- name: Generate Code Coverage (Vitest) | |
run: yarn coverage | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit --allow-empty -m "Build, test, and coverage report" | |
git push |