Skip to content

fix for CI script

fix for CI script #44

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: πŸ› οΈ Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: πŸ”„ Clear Cache
run: npm run clean
- name: πŸ”„ Ensure package-lock.json is up-to-date
run: npm install --package-lock-only --ignore-scripts --legacy-peer-deps
- name: πŸ“¦ Install dependencies
run: npm ci --legacy-peer-deps
- name: 🐢 Set up Husky
run: npx husky install
- name: πŸ–‹οΈ Format code
run: npm run format
- name: 🧹 Lint code
run: npm run lint
- name: πŸ“ Generate test files
run: npm run generate-tests
- name: πŸ–‹οΈ Format generated test files
run: npm run format
- name: πŸ”¨ Build
run: npm run build
- name: πŸ§ͺ Test with coverage
run: npm run test
- name: πŸ“€ Commit and push all changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
if ! git diff --quiet; then
git add -A
git commit -m 'πŸ€– Auto-commit changes from CI'
git push
else
echo "No changes detected. Skipping commit."
fi
shell: /usr/bin/bash -e {0}
# Deploy build to GitHub Pages
- name: πŸš€ Deploy dist to GitHub Pages
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages