Update npm-update.yml #105
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: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: 🔄 Checkout code | |
uses: actions/checkout@v4 | |
- name: 🔧 Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: 📦 Install dependencies | |
run: npm install | |
- name: 🖋️ Check formatting | |
run: | | |
npx prettier --check . || ( | |
echo "Formatting issues detected. Running Prettier to fix..." && | |
npx prettier --write . && | |
git config --local user.name "Debugging Duck 🦆" && | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" && | |
git add . && | |
git commit -m "💄 Fix formatting issues with Prettier" || echo "No changes to commit." | |
) | |
- name: 🧹 Lint code | |
run: npm run lint | |
- name: 🧪 Run tests with coverage | |
run: npm run test | |
env: | |
CI: true | |
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
APP_ID: ${{ secrets.APP_ID }} | |
PROBOT_GITHUB_TOKEN: ${{ secrets.PROBOT_GITHUB_TOKEN }} | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🚀 Deploy | |
run: echo "Replace this with your deployment commands" |