refactor: modularize woodpecker pipeline configuration into separate build and deployment files

This commit is contained in:
vickytechkey 2026-08-07 17:56:22 +05:30
parent e7e687c081
commit 2cafbae36b
4 changed files with 76 additions and 50 deletions

View file

@ -1,50 +0,0 @@
when:
- event: [push, pull_request]
steps:
- name: install
image: node:20-alpine
commands:
- npm ci
- name: lint
image: node:20-alpine
commands:
- npm run lint
- name: build
image: node:20-alpine
commands:
- npm run build
- name: deploy-prod
image: alpine:3.18
environment:
FTP_USERNAME:
from_secret: ftp_username
FTP_PASSWORD:
from_secret: ftp_password
FTP_HOST:
from_secret: ftp_host
commands:
- apk add --no-cache lftp
- lftp -d -u "$FTP_USERNAME","$FTP_PASSWORD" -e "set ssl:verify-certificate no; set ftp:ssl-allow yes; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ftp:passive-mode true; mirror -R dist/ ./; quit" $FTP_HOST
when:
- branch: main
event: push
- name: deploy-beta
image: alpine:3.18
environment:
FTP_USERNAME:
from_secret: beta_ftp_username
FTP_PASSWORD:
from_secret: beta_ftp_password
FTP_HOST:
from_secret: ftp_host
commands:
- apk add --no-cache lftp
- lftp -d -u "$FTP_USERNAME","$FTP_PASSWORD" -e "set ssl:verify-certificate no; set ftp:ssl-allow yes; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ftp:passive-mode true; mirror -R dist/ ./; quit" $FTP_HOST
when:
- branch: beta
event: push

18
.woodpecker/build.yml Normal file
View file

@ -0,0 +1,18 @@
when:
- event: [push, pull_request]
steps:
- name: install
image: node:20-alpine
commands:
- npm ci
- name: lint
image: node:20-alpine
commands:
- npm run lint
- name: build
image: node:20-alpine
commands:
- npm run build

View file

@ -0,0 +1,29 @@
when:
- branch: beta
event: push
- event: deployment
environment: beta
steps:
- name: install
image: node:20-alpine
commands:
- npm ci
- name: build
image: node:20-alpine
commands:
- npm run build
- name: deploy-beta
image: alpine:3.18
environment:
FTP_USERNAME:
from_secret: beta_ftp_username
FTP_PASSWORD:
from_secret: beta_ftp_password
FTP_HOST:
from_secret: ftp_host
commands:
- apk add --no-cache lftp
- lftp -d -u "$FTP_USERNAME","$FTP_PASSWORD" -e "set ssl:verify-certificate no; set ftp:ssl-allow yes; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ftp:passive-mode true; mirror -R dist/ ./; quit" $FTP_HOST

View file

@ -0,0 +1,29 @@
when:
- branch: main
event: push
- event: deployment
environment: production
steps:
- name: install
image: node:20-alpine
commands:
- npm ci
- name: build
image: node:20-alpine
commands:
- npm run build
- name: deploy-prod
image: alpine:3.18
environment:
FTP_USERNAME:
from_secret: ftp_username
FTP_PASSWORD:
from_secret: ftp_password
FTP_HOST:
from_secret: ftp_host
commands:
- apk add --no-cache lftp
- lftp -d -u "$FTP_USERNAME","$FTP_PASSWORD" -e "set ssl:verify-certificate no; set ftp:ssl-allow yes; set ftp:ssl-force true; set ftp:ssl-protect-data true; set ftp:passive-mode true; mirror -R dist/ ./; quit" $FTP_HOST