🚀 Make deploy-to-VPS workflow template-safe #17
This file contains hidden or 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: Auto Lint & Format | |
| on: [push, pull_request] | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| # Skip npm ci if no lockfile exists | |
| - name: Skip npm ci if no package-lock | |
| run: | | |
| if [ -f package-lock.json ]; then | |
| npm ci | |
| else | |
| echo "🔧 No package-lock.json, skipping npm ci" | |
| fi | |
| - name: Run Prettier | |
| run: npx prettier --write . | |
| - name: Run ESLint | |
| run: npx eslint . --fix |