This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
# Build workflow: runs after lint (shared workspace).
|
|
||||||
# Same triggers as lint: PR, push/tag/manual on main, or manual.
|
|
||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
- event: tag
|
|
||||||
- event: manual
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- lint
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build
|
|
||||||
image: node:20-alpine
|
|
||||||
commands:
|
|
||||||
- corepack enable && corepack prepare pnpm@10.28.2 --activate
|
|
||||||
- pnpm run build
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# Lint workflow: install deps + run lint (shared workspace with build, test).
|
# CI workflow: one clone, one workspace — install → lint → build → test.
|
||||||
# Runs on pull requests, push/tag/manual on main, or manual from any branch.
|
# Runs on pull requests, push/tag/manual on main, or manual from any branch.
|
||||||
|
# Deploy workflow depends on this (ci) and runs only on main.
|
||||||
when:
|
when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
- event: push
|
- event: push
|
||||||
@@ -20,3 +21,15 @@ steps:
|
|||||||
- corepack enable && corepack prepare pnpm@10.28.2 --activate
|
- corepack enable && corepack prepare pnpm@10.28.2 --activate
|
||||||
- pnpm run lint
|
- pnpm run lint
|
||||||
- pnpm run lint:css
|
- pnpm run lint:css
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: node:20-alpine
|
||||||
|
commands:
|
||||||
|
- corepack enable && corepack prepare pnpm@10.28.2 --activate
|
||||||
|
- pnpm run build
|
||||||
|
|
||||||
|
- name: test
|
||||||
|
image: node:20-alpine
|
||||||
|
commands:
|
||||||
|
- corepack enable && corepack prepare pnpm@10.28.2 --activate
|
||||||
|
- pnpm test
|
||||||
@@ -1,14 +1,12 @@
|
|||||||
# Deploy workflow: Docker image → push to registry → Portainer webhook.
|
# Deploy workflow: Docker image → push to registry → Portainer webhook.
|
||||||
# Runs on push to main, tag, or manual (only when on main).
|
# Runs on push to main, tag, or manual (only when on main).
|
||||||
# Waits for lint, build, and test workflows to succeed first.
|
# Waits for ci workflow (install → lint → build → test) to succeed first.
|
||||||
when:
|
when:
|
||||||
branch: main
|
branch: main
|
||||||
event: [push, tag, manual]
|
event: [push, tag, manual]
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint
|
- ci
|
||||||
- build
|
|
||||||
- test
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 'Docker image build'
|
- name: 'Docker image build'
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
# Test workflow: runs after lint and build (shared workspace).
|
|
||||||
# Same triggers as lint: PR, push/tag/manual on main, or manual.
|
|
||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
- event: tag
|
|
||||||
- event: manual
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- lint
|
|
||||||
- build
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: test
|
|
||||||
image: node:20-alpine
|
|
||||||
commands:
|
|
||||||
- corepack enable && corepack prepare pnpm@10.28.2 --activate
|
|
||||||
- pnpm test
|
|
||||||
12
README.md
12
README.md
@@ -104,10 +104,8 @@ mifi-ventures-landing/
|
|||||||
│ ├── devcontainer.json # Dev container config (extensions)
|
│ ├── devcontainer.json # Dev container config (extensions)
|
||||||
│ └── Dockerfile # Dev container image (Node)
|
│ └── Dockerfile # Dev container image (Node)
|
||||||
├── .woodpecker/ # CI/CD pipelines (see below)
|
├── .woodpecker/ # CI/CD pipelines (see below)
|
||||||
│ ├── lint.yaml # install + lint (runs on PR, main, manual)
|
│ ├── ci.yaml # one clone/workspace: install → lint → build → test
|
||||||
│ ├── build.yaml # build (after lint)
|
│ └── deploy.yaml # Docker → push → webhook (main only, after ci)
|
||||||
│ ├── test.yaml # test (after lint + build)
|
|
||||||
│ └── deploy.yaml # Docker → push → webhook (main only, after lint/build/test)
|
|
||||||
├── Dockerfile # Production container (nginx:alpine)
|
├── Dockerfile # Production container (nginx:alpine)
|
||||||
├── nginx.conf # nginx web server configuration
|
├── nginx.conf # nginx web server configuration
|
||||||
├── svelte.config.js # SvelteKit config (adapter-static)
|
├── svelte.config.js # SvelteKit config (adapter-static)
|
||||||
@@ -142,10 +140,10 @@ mifi-ventures-landing/
|
|||||||
|
|
||||||
### Pipeline Overview
|
### Pipeline Overview
|
||||||
|
|
||||||
Woodpecker uses four workflows (`.woodpecker/lint.yaml`, `build.yaml`, `test.yaml`, `deploy.yaml`):
|
Woodpecker uses two workflows (`.woodpecker/ci.yaml`, `deploy.yaml`):
|
||||||
|
|
||||||
- **Pull requests** (and **push/tag/manual on main**): Run **lint** → **build** → **test** in order (shared workspace). No Docker or deploy on PRs.
|
- **Pull requests** (and **push/tag/manual on main**): **ci** runs install → lint → build → test in one workspace (one clone, one install). No Docker or deploy on PRs.
|
||||||
- **Push to main** (or tag / manual on main): After lint, build, and test succeed, **deploy** runs:
|
- **Push to main** (or tag / manual on main): After ci succeeds, **deploy** runs:
|
||||||
1. **Build** — Builds Docker image tagged with commit SHA + `latest`
|
1. **Build** — Builds Docker image tagged with commit SHA + `latest`
|
||||||
|
|
||||||
2. **Push** — Pushes images to private Docker registry
|
2. **Push** — Pushes images to private Docker registry
|
||||||
|
|||||||
Reference in New Issue
Block a user