ci: rework ci
All checks were successful
ci/woodpecker/push/cd Pipeline was successful

This commit is contained in:
bdeshi 2024-05-17 11:06:14 +06:00
parent 2c63eeee54
commit b90b0db806
Signed by: bdeshi
GPG Key ID: 410D03DA9A3468E0
3 changed files with 38 additions and 43 deletions

View File

@ -1,27 +0,0 @@
# https://woodpecker-ci.org/docs/intro
when:
event: [push, manual]
branch: main
steps:
- name: build/yarn
image: node:18
when:
- path:
exclude: ['_meta/**']
commands:
- yarn install
- yarn build
- name: publish/s3
image: amazon/aws-cli:2.15.50
commands:
- aws s3 sync --delete ./dist s3://$${S3_BUCKET}/
secrets:
- S3_BUCKET
- CLOUDFRONT_DISTRIBUTION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
depends_on: [ build/yarn ]

View File

@ -1,16 +0,0 @@
when:
event: [push, manual]
branch: main
steps:
- name: publish/cloudfront
image: amazon/aws-cli:2.15.50
commands:
- aws cloudfront create-invalidation --distribution-id $${CLOUDFRONT_DISTRIBUTION} --paths '/*'
secrets:
- S3_BUCKET
- CLOUDFRONT_DISTRIBUTION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
depends_on: [ build ]

38
.woodpecker/cd.yml Normal file
View File

@ -0,0 +1,38 @@
# https://woodpecker-ci.org/docs/intro
when:
event: [push, manual]
branch: main
variables:
secrets: &secrets
- S3_BUCKET
- CLOUDFRONT_DISTRIBUTION
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
steps:
- name: build/yarn
image: node:18
# when:
# - path:
# exclude: ['_meta/**']
commands:
- yarn install
- yarn build
- name: publish/s3
image: amazon/aws-cli:2.15.50
commands:
- aws s3 sync --delete ./dist s3://$${S3_BUCKET}/
secrets:
- <<: *secrets
- name: publish/cloudfront
image: amazon/aws-cli:2.15.50
commands:
- aws cloudfront create-invalidation --distribution-id $${CLOUDFRONT_DISTRIBUTION} --paths '/*'
secrets:
- <<: *secrets