feat(ci): run on every branch
This commit is contained in:
@@ -2,16 +2,13 @@ name: 🏗️ Build and Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: "main"
|
branches: ["*"]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PNPM_CACHE_FOLDER: .pnpm-store
|
PNPM_CACHE_FOLDER: .pnpm-store
|
||||||
|
|
||||||
jobs:
|
x-templates:
|
||||||
lint:
|
setup-steps: &setup-steps
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: jimfx/nodes:latest
|
|
||||||
steps:
|
|
||||||
- name: 📑 Checkout Code
|
- name: 📑 Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -24,6 +21,12 @@ jobs:
|
|||||||
- name: 📦 Install Dependencies
|
- name: 📦 Install Dependencies
|
||||||
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
run: pnpm install --frozen-lockfile --store-dir ${{ env.PNPM_CACHE_FOLDER }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: jimfx/nodes:latest
|
||||||
|
steps:
|
||||||
|
- <<: *setup-steps
|
||||||
- name: 🧹 Run Linter
|
- name: 🧹 Run Linter
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
|
|
||||||
@@ -31,18 +34,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: jimfx/nodes:latest
|
container: jimfx/nodes:latest
|
||||||
steps:
|
steps:
|
||||||
- name: 📑 Checkout Code
|
- <<: *setup-steps
|
||||||
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 }}
|
|
||||||
|
|
||||||
- name: 🎨 Check Formatting
|
- name: 🎨 Check Formatting
|
||||||
run: pnpm format:check
|
run: pnpm format:check
|
||||||
|
|
||||||
@@ -50,37 +42,17 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: jimfx/nodes:latest
|
container: jimfx/nodes:latest
|
||||||
steps:
|
steps:
|
||||||
- name: 📑 Checkout Code
|
- <<: *setup-steps
|
||||||
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 }}
|
|
||||||
|
|
||||||
- name: 🧬 Type Check
|
- name: 🧬 Type Check
|
||||||
run: pnpm check
|
run: pnpm check
|
||||||
|
|
||||||
build_and_deploy:
|
build_and_deploy:
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
needs: [lint, format, typecheck]
|
needs: [lint, format, typecheck]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: jimfx/nodes:latest
|
container: jimfx/nodes:latest
|
||||||
steps:
|
steps:
|
||||||
- name: 📑 Checkout Code
|
- <<: *setup-steps
|
||||||
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 }}
|
|
||||||
|
|
||||||
- name: 🛠️ Build Site
|
- name: 🛠️ Build Site
|
||||||
run: pnpm run build:deploy
|
run: pnpm run build:deploy
|
||||||
|
|||||||
Reference in New Issue
Block a user