The Svelte 5 SSG Migration #1
@@ -1,8 +1,11 @@
|
|||||||
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
|
# Build workflow: runs after lint (shared workspace).
|
||||||
# Runs when a pull request is opened or updated.
|
# Same triggers as lint: PR, push/tag/manual on main, or manual.
|
||||||
# Does not build Docker image or deploy.
|
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
- event: pull_request
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
- event: tag
|
||||||
|
- event: manual
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
- name: build
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Deploy pipeline: lint, test, build, then Docker image → registry → Portainer webhook.
|
# Deploy workflow: Docker image → push to registry → Portainer webhook.
|
||||||
# Runs on push to main, tag, or manual run.
|
# Runs on push to main, tag, or manual (only when on main).
|
||||||
# See lint-and-build.yaml for PR-only (lint + test + build).
|
# Waits for lint, build, and test workflows to succeed first.
|
||||||
when:
|
when:
|
||||||
branch: main
|
branch: main
|
||||||
event: [push, tag, manual]
|
event: [push, tag, manual]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: 'Docker image build'
|
- name: docker-build
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
environment:
|
environment:
|
||||||
REGISTRY_REPO: git.mifi.dev/mifi-ventures/landing
|
REGISTRY_REPO: git.mifi.dev/mifi-ventures/landing
|
||||||
@@ -30,7 +30,7 @@ steps:
|
|||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
|
||||||
- name: 'Push to registry'
|
- name: push
|
||||||
image: docker:latest
|
image: docker:latest
|
||||||
environment:
|
environment:
|
||||||
REGISTRY_URL: git.mifi.dev
|
REGISTRY_URL: git.mifi.dev
|
||||||
@@ -54,9 +54,9 @@ steps:
|
|||||||
- docker push $REGISTRY_REPO:latest
|
- docker push $REGISTRY_REPO:latest
|
||||||
- echo "✓ Images pushed successfully"
|
- echo "✓ Images pushed successfully"
|
||||||
depends_on:
|
depends_on:
|
||||||
- 'Docker image build'
|
- docker-build
|
||||||
|
|
||||||
- name: 'Trigger Portainer stack redeploy'
|
- name: deploy
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
environment:
|
environment:
|
||||||
PORTAINER_WEBHOOK_URL:
|
PORTAINER_WEBHOOK_URL:
|
||||||
@@ -74,4 +74,4 @@ steps:
|
|||||||
fi
|
fi
|
||||||
echo "✓ Portainer redeploy triggered (HTTP $code)"
|
echo "✓ Portainer redeploy triggered (HTTP $code)"
|
||||||
depends_on:
|
depends_on:
|
||||||
- 'Push to registry'
|
- push
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
|
# Lint workflow: install deps + run lint (shared workspace with build, test).
|
||||||
# Runs when a pull request is opened or updated.
|
# Runs on pull requests, push/tag/manual on main, or manual from any branch.
|
||||||
# Does not build Docker image or deploy.
|
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
- event: pull_request
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
- event: tag
|
||||||
|
- event: manual
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: install
|
- name: install
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
|
# Test workflow: runs after lint and build (shared workspace).
|
||||||
# Runs when a pull request is opened or updated.
|
# Same triggers as lint: PR, push/tag/manual on main, or manual.
|
||||||
# Does not build Docker image or deploy.
|
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
- event: pull_request
|
||||||
|
- event: push
|
||||||
|
branch: main
|
||||||
|
- event: tag
|
||||||
|
- event: manual
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: test
|
- name: test
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -104,8 +104,10 @@ 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-and-build.yaml # PR: lint, test, build (no deploy)
|
│ ├── lint.yaml # install + lint (runs on PR, main, manual)
|
||||||
│ └── deploy.yaml # main: lint, test, build, Docker, push, webhook
|
│ ├── build.yaml # build (after lint)
|
||||||
|
│ ├── 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)
|
||||||
@@ -140,10 +142,10 @@ mifi-ventures-landing/
|
|||||||
|
|
||||||
### Pipeline Overview
|
### Pipeline Overview
|
||||||
|
|
||||||
Woodpecker uses two workflows (`.woodpecker/lint-and-build.yaml` and `.woodpecker/deploy.yaml`):
|
Woodpecker uses four workflows (`.woodpecker/lint.yaml`, `build.yaml`, `test.yaml`, `deploy.yaml`):
|
||||||
|
|
||||||
- **Pull requests**: Opening or updating a PR runs **lint** (ESLint + Stylelint), **tests** (Vitest), and a **test build** (SvelteKit + Critters) on the branch. No Docker image or deploy.
|
- **Pull requests** (and **push/tag/manual on main**): Run **lint** → **build** → **test** in order (shared workspace). No Docker or deploy on PRs.
|
||||||
- **Push to main** (or tag / manual run): Runs the same lint, test, and build, then:
|
- **Push to main** (or tag / manual on main): After lint, build, and test succeed, **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