-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-deploy-to-s3-action.yml
28 lines (26 loc) · 1.08 KB
/
react-deploy-to-s3-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
# File: react-deploy-to-s3-action.yml
# Sync a built React application to an AWS S3 repository.
parameters:
- name: bucket
type: string
- name: env
type: string
steps:
- task: AWSShellScript@1
inputs:
awsCredentials: ${{ parameters.env }}
regionName: eu-west-1
scriptType: 'inline'
inlineScript: aws s3 sync build s3://${{ parameters.bucket }}/ --metadata-directive REPLACE --cache-control max-age=86400 --exclude index.html --exclude 'static/*' --no-progress --delete $*
- task: AWSShellScript@1
inputs:
awsCredentials: ${{ parameters.env }}
regionName: eu-west-1
scriptType: 'inline'
inlineScript: aws s3 sync build/static s3://${{ parameters.bucket }}/static --metadata-directive REPLACE --cache-control max-age=31536000 --no-progress $*
- task: AWSShellScript@1
inputs:
awsCredentials: ${{ parameters.env }}
regionName: eu-west-1
scriptType: 'inline'
inlineScript: aws s3 cp build/index.html s3://${{ parameters.bucket }}/ --metadata-directive REPLACE --cache-control max-age=5 --no-progress $*