Skip to content

Commit e85a11f

Browse files
authored
Merge pull request #19 from ThuyNT13/github-actions
cloudfront and concurrency
2 parents 2dfbd64 + de8fa66 commit e85a11f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/aws.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to S3
1+
name: S3-sync
22

33
on:
44
push:
@@ -9,6 +9,10 @@ permissions:
99
id-token: write # required for requesting the JWT for OpenID Connect (OIDC)
1010
contents: read # required for actions/checkout
1111

12+
concurrency:
13+
group: ci-${{ github.workflow }}-${{ github.ref_name }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
deploy:
1418
runs-on: ubuntu-slim
@@ -36,3 +40,9 @@ jobs:
3640
--exclude ".github/*" \
3741
--exclude "README.md" \
3842
--exclude "LICENSE"
43+
44+
- name: invalidate CloudFront cache
45+
run: |
46+
aws cloudfront create-invalidation \
47+
--distribution-id ${{ vars.CF_DISTRIBUTION_ID }} \
48+
--paths "/*"

0 commit comments

Comments
 (0)