Pipeline re-working v2

This commit is contained in:
2026-01-31 12:33:34 -03:00
parent 3ffb9de80a
commit 3d5f79ba08
5 changed files with 36 additions and 25 deletions

View File

@@ -1,8 +1,11 @@
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
# Runs when a pull request is opened or updated.
# Does not build Docker image or deploy.
# Build workflow: runs after lint (shared workspace).
# Same triggers as lint: PR, push/tag/manual on main, or manual.
when:
event: pull_request
- event: pull_request
- event: push
branch: main
- event: tag
- event: manual
steps:
- name: build

View File

@@ -1,12 +1,12 @@
# Deploy pipeline: lint, test, build, then Docker image → registry → Portainer webhook.
# Runs on push to main, tag, or manual run.
# See lint-and-build.yaml for PR-only (lint + test + build).
# Deploy workflow: Docker image → push to registry → Portainer webhook.
# Runs on push to main, tag, or manual (only when on main).
# Waits for lint, build, and test workflows to succeed first.
when:
branch: main
event: [push, tag, manual]
steps:
- name: 'Docker image build'
- name: docker-build
image: docker:latest
environment:
REGISTRY_REPO: git.mifi.dev/mifi-ventures/landing
@@ -30,7 +30,7 @@ steps:
- build
- test
- name: 'Push to registry'
- name: push
image: docker:latest
environment:
REGISTRY_URL: git.mifi.dev
@@ -54,9 +54,9 @@ steps:
- docker push $REGISTRY_REPO:latest
- echo "✓ Images pushed successfully"
depends_on:
- 'Docker image build'
- docker-build
- name: 'Trigger Portainer stack redeploy'
- name: deploy
image: curlimages/curl:latest
environment:
PORTAINER_WEBHOOK_URL:
@@ -74,4 +74,4 @@ steps:
fi
echo "✓ Portainer redeploy triggered (HTTP $code)"
depends_on:
- 'Push to registry'
- push

View File

@@ -1,8 +1,11 @@
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
# Runs when a pull request is opened or updated.
# Does not build Docker image or deploy.
# Lint workflow: install deps + run lint (shared workspace with build, test).
# Runs on pull requests, push/tag/manual on main, or manual from any branch.
when:
event: pull_request
- event: pull_request
- event: push
branch: main
- event: tag
- event: manual
steps:
- name: install

View File

@@ -1,8 +1,11 @@
# PR pipeline: lint, build, test on the branch (separate steps, shared workspace).
# Runs when a pull request is opened or updated.
# Does not build Docker image or deploy.
# 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: pull_request
- event: push
branch: main
- event: tag
- event: manual
steps:
- name: test

View File

@@ -104,8 +104,10 @@ mifi-ventures-landing/
│ ├── devcontainer.json # Dev container config (extensions)
│ └── Dockerfile # Dev container image (Node)
├── .woodpecker/ # CI/CD pipelines (see below)
│ ├── lint-and-build.yaml # PR: lint, test, build (no deploy)
── deploy.yaml # main: lint, test, build, Docker, push, webhook
│ ├── lint.yaml # install + lint (runs on PR, main, manual)
── 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)
├── nginx.conf # nginx web server configuration
├── svelte.config.js # SvelteKit config (adapter-static)
@@ -140,10 +142,10 @@ mifi-ventures-landing/
### 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.
- **Push to main** (or tag / manual run): Runs the same lint, test, and build, then:
- **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 on main): After lint, build, and test succeed, **deploy** runs:
1. **Build** — Builds Docker image tagged with commit SHA + `latest`
2. **Push** — Pushes images to private Docker registry