Last active
July 13, 2022 12:42
-
-
Save Giwan/2c6a68a418115309d6e94a161fe78783 to your computer and use it in GitHub Desktop.
AWS command in GitHub Workflow to copy the index.html file and add cache-header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ "$1" != "" ]]; then | |
| BUCKETNAME="$1" | |
| else | |
| echo ERROR: A bucket name is required to proceed. | |
| exit 1 | |
| fi | |
| # copy from the same bucket and update the meta data. | |
| aws s3 cp s3://$BUCKETNAME/index.html s3://$BUCKETNAME/index.html \ | |
| --metadata-directive REPLACE --cache-control "private, no-store" --content-type "text/html" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment