Add lint and build github workflow

This commit is contained in:
AdityaSalunkhe21 2025-12-19 12:18:04 +05:30
parent 2ee6d3ea00
commit f36a6bb87c

61
.github/workflows/lint-and-build.yml vendored Normal file
View File

@ -0,0 +1,61 @@
name: Lint and Build
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run Prettier format check
run: yarn prettier --check .
build:
name: Build
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build project
run: yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/
retention-days: 7