-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
39 lines (33 loc) · 1.01 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: 'Sync files to S3'
description: 'Sync files to S3 and invalidate CloudFront'
inputs:
source:
description: 'Path to the folder to sync.'
required: true
bucket:
description: 'Name of the S3 bucket to sync to.'
required: true
delete:
description: 'Delete files that exist in the destination but not in the source during sync.'
required: false
distribution-id:
description: 'The CloudFront distribution id. If provided, the distribution will be invalidated after the sync.'
required: false
runs:
using: composite
steps:
- name: 'Sync files'
shell: bash
#language=bash
run: |
aws s3 sync "${{ inputs.source }}" \
"s3://${{ inputs.bucket }}" \
${{ inputs.delete && '--delete' }}
- name: 'Invalidate CloudFront'
if: inputs.distribution-id != ''
shell: bash
#language=bash
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ inputs.distribution-id }} \
--paths "/*"