ci: improve step run conditions

This commit is contained in:
bdeshi 2024-05-20 20:51:29 +06:00
parent b90b0db806
commit 1cda00dcd3
Signed by: bdeshi
GPG Key ID: 410D03DA9A3468E0

View File

@ -2,7 +2,6 @@
when: when:
event: [push, manual] event: [push, manual]
branch: main
variables: variables:
secrets: &secrets secrets: &secrets
@ -16,14 +15,14 @@ variables:
steps: steps:
- name: build/yarn - name: build/yarn
image: node:18 image: node:18
# when:
# - path:
# exclude: ['_meta/**']
commands: commands:
- yarn install - yarn install
- yarn build - yarn build
- name: publish/s3 - name: publish/s3
depends_on: [ build/yarn ]
when:
- branch: main
image: amazon/aws-cli:2.15.50 image: amazon/aws-cli:2.15.50
commands: commands:
- aws s3 sync --delete ./dist s3://$${S3_BUCKET}/ - aws s3 sync --delete ./dist s3://$${S3_BUCKET}/
@ -31,6 +30,9 @@ steps:
- <<: *secrets - <<: *secrets
- name: publish/cloudfront - name: publish/cloudfront
depends_on: [ publish/s3 ]
when:
- branch: main
image: amazon/aws-cli:2.15.50 image: amazon/aws-cli:2.15.50
commands: commands:
- aws cloudfront create-invalidation --distribution-id $${CLOUDFRONT_DISTRIBUTION} --paths '/*' - aws cloudfront create-invalidation --distribution-id $${CLOUDFRONT_DISTRIBUTION} --paths '/*'