Skip to content

Commit

Permalink
chore: Add lint and format job for automatic linting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gohan5858 committed Oct 26, 2024
1 parent 023d630 commit 2d2f68f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,29 @@ env:
on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint

- name: Run Prettier
run: npm run format:check

preview:
needs: lint
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
environment:
Expand Down Expand Up @@ -45,6 +67,7 @@ jobs:
run: vercel alias ${{ steps.deploy.outputs.url }} stg.my-service.com --scope=my-team --token=${{ secrets.VERCEL_TOKEN }}

prod:
needs: lint
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 2d2f68f

Please sign in to comment.