48 lines
913 B
YAML
48 lines
913 B
YAML
name: CI/CD Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install pnpm
|
|
run: npm install -g pnpm
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: pnpm run lint
|
|
|
|
- name: Build
|
|
run: pnpm run build
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- name: Test
|
|
run: pnpm run test -- --passWithNoTests
|
|
env:
|
|
NODE_ENV: test
|
|
|
|
deploy:
|
|
needs: ci
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Deploy
|
|
run: |
|
|
echo "Deployment handled via webhook"
|