chore: setup linting #29
@@ -2,28 +2,31 @@ name: 🏗️ Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: "main"
|
||||
branches: ["*"]
|
||||
|
||||
env:
|
||||
PNPM_CACHE_FOLDER: .pnpm-store
|
||||
|
||||
x-templates:
|
||||
setup-steps: &setup-steps
|
||||
- name: 📑 Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 💾 Setup pnpm Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PNPM_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
container: jimfx/nodes:latest
|
||||
steps:
|
||||
- name: 📑 Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 💾 Setup pnpm Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PNPM_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||
|
||||
- <<: *setup-steps
|
||||
- name: 🧹 Run Linter
|
||||
run: pnpm lint
|
||||
|
||||
@@ -31,18 +34,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container: jimfx/nodes:latest
|
||||
steps:
|
||||
- name: 📑 Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 💾 Setup pnpm Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PNPM_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||
|
||||
- <<: *setup-steps
|
||||
- name: 🎨 Check Formatting
|
||||
run: pnpm format:check
|
||||
|
||||
@@ -50,37 +42,17 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container: jimfx/nodes:latest
|
||||
steps:
|
||||
- name: 📑 Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 💾 Setup pnpm Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PNPM_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||
|
||||
- <<: *setup-steps
|
||||
- name: 🧬 Type Check
|
||||
run: pnpm check
|
||||
|
||||
build_and_deploy:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
needs: [lint, format, typecheck]
|
||||
runs-on: ubuntu-latest
|
||||
container: jimfx/nodes:latest
|
||||
steps:
|
||||
- name: 📑 Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 💾 Setup pnpm Cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.PNPM_CACHE_FOLDER }}
|
||||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
|
||||
- name: 📦 Install Dependencies
|
||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||
- <<: *setup-steps
|
||||
|
||||
- name: 🛠️ Build Site
|
||||
run: pnpm run build:deploy
|
||||
|
||||
Reference in New Issue
Block a user