Skip to content

Instantly share code, notes, and snippets.

@Giwan
Last active July 13, 2022 12:42
Show Gist options
  • Select an option

  • Save Giwan/2c6a68a418115309d6e94a161fe78783 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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