Add Github Actions #1
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: CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: npm install | |
- name: Run ESLint | |
run: npm run lint | |
- name: Run tests | |
run: npm test | |
- name: Build the project | |
run: npm run build | |
- name: Commit built files | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git add dist/ | |
git commit -m "Build and minify files [skip ci]" | |
if: success() | |
- name: Push changes | |
run: git push | |
if: success() |