From 3ffb9de80a258411e22f80459b0eaf78a729c280 Mon Sep 17 00:00:00 2001 From: mifi Date: Sat, 31 Jan 2026 11:52:13 -0300 Subject: [PATCH] New pipelines... --- .woodpecker/build.yaml | 14 +++++++++++ .woodpecker/deploy.yaml | 24 +++++++------------ .../{lint-and-build.yaml => lint.yaml} | 12 ---------- .woodpecker/test.yaml | 15 ++++++++++++ 4 files changed, 37 insertions(+), 28 deletions(-) create mode 100644 .woodpecker/build.yaml rename .woodpecker/{lint-and-build.yaml => lint.yaml} (65%) create mode 100644 .woodpecker/test.yaml diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml new file mode 100644 index 0000000..cff1c4e --- /dev/null +++ b/.woodpecker/build.yaml @@ -0,0 +1,14 @@ +# 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. +when: + event: pull_request + +steps: + - name: build + image: node:20-alpine + commands: + - corepack enable && corepack prepare pnpm@10.28.2 --activate + - pnpm run build + depends_on: + - lint diff --git a/.woodpecker/deploy.yaml b/.woodpecker/deploy.yaml index 21388b5..77f6b3a 100644 --- a/.woodpecker/deploy.yaml +++ b/.woodpecker/deploy.yaml @@ -6,17 +6,7 @@ when: event: [push, tag, manual] steps: - - name: build-and-test - image: node:20-alpine - commands: - - corepack enable && corepack prepare pnpm@10.28.2 --activate - - pnpm install --frozen-lockfile || pnpm install - - pnpm run lint - - pnpm run lint:css - - pnpm run build - - pnpm test - - - name: build + - name: 'Docker image build' image: docker:latest environment: REGISTRY_REPO: git.mifi.dev/mifi-ventures/landing @@ -36,9 +26,11 @@ steps: . - echo "✓ Docker image built successfully" depends_on: - - build-and-test + - lint + - build + - test - - name: push + - name: 'Push to registry' image: docker:latest environment: REGISTRY_URL: git.mifi.dev @@ -62,9 +54,9 @@ steps: - docker push $REGISTRY_REPO:latest - echo "✓ Images pushed successfully" depends_on: - - build + - 'Docker image build' - - name: deploy + - name: 'Trigger Portainer stack redeploy' image: curlimages/curl:latest environment: PORTAINER_WEBHOOK_URL: @@ -82,4 +74,4 @@ steps: fi echo "✓ Portainer redeploy triggered (HTTP $code)" depends_on: - - push + - 'Push to registry' diff --git a/.woodpecker/lint-and-build.yaml b/.woodpecker/lint.yaml similarity index 65% rename from .woodpecker/lint-and-build.yaml rename to .woodpecker/lint.yaml index a510f23..27326eb 100644 --- a/.woodpecker/lint-and-build.yaml +++ b/.woodpecker/lint.yaml @@ -17,15 +17,3 @@ steps: - corepack enable && corepack prepare pnpm@10.28.2 --activate - pnpm run lint - 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 diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml new file mode 100644 index 0000000..bac563c --- /dev/null +++ b/.woodpecker/test.yaml @@ -0,0 +1,15 @@ +# 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. +when: + event: pull_request + +steps: + - name: test + image: node:20-alpine + commands: + - corepack enable && corepack prepare pnpm@10.28.2 --activate + - pnpm test + depends_on: + - lint + - build