diff --git a/.woodpecker/deploy-beta.yml b/.woodpecker.yml similarity index 50% rename from .woodpecker/deploy-beta.yml rename to .woodpecker.yml index 2baa11d..4082300 100644 --- a/.woodpecker/deploy-beta.yml +++ b/.woodpecker.yml @@ -1,6 +1,5 @@ when: - - event: deployment - environment: beta + - event: [push, pull_request, deployment] steps: - name: install @@ -8,6 +7,11 @@ steps: commands: - npm ci + - name: lint + image: node:20-alpine + commands: + - npm run lint + - name: test image: node:20-alpine commands: @@ -18,6 +22,22 @@ steps: 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: + - event: deployment + environment: production + - name: deploy-beta image: alpine:3.18 environment: @@ -30,3 +50,6 @@ steps: 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: + - event: deployment + environment: beta diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml deleted file mode 100644 index fbfc174..0000000 --- a/.woodpecker/build.yml +++ /dev/null @@ -1,23 +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: test - image: node:20-alpine - commands: - - npm run test - - - name: build - image: node:20-alpine - commands: - - npm run build diff --git a/.woodpecker/deploy-prod.yml b/.woodpecker/deploy-prod.yml deleted file mode 100644 index e8b75b4..0000000 --- a/.woodpecker/deploy-prod.yml +++ /dev/null @@ -1,32 +0,0 @@ -when: - - event: deployment - environment: production - -steps: - - name: install - image: node:20-alpine - commands: - - npm ci - - - name: test - image: node:20-alpine - commands: - - npm run test - - - 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