Skip to content

Instantly share code, notes, and snippets.

@tomas-chudjak
Last active May 6, 2020 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomas-chudjak/f71aa4f96d53ab9db047b5f81b88ee57 to your computer and use it in GitHub Desktop.
Save tomas-chudjak/f71aa4f96d53ab9db047b5f81b88ee57 to your computer and use it in GitHub Desktop.
VSCode task to upload Hugo's public/ folder to s3 bucket
{
"version": "2.0.0",
"tasks": [
{
"label": "S3 deploy",
"type": "shell",
"command": "hugo --minify && aws s3 sync public/ ${input:s3bucket} --delete --exclude \"*css\" --exclude \"*.js\" --exclude \"*.png\" --exclude \"*.jpg\" --exclude \"*.woff\" && echo '--- s3 upload with cache-control: ---' && aws s3 cp public/ ${input:s3bucket} --recursive --exclude \"*\" --include \"*css\" --include \"*.js\" --include \"*.png\" --include \"*.jpg\" --include \"*.webp\" --include \"*.woff\" --cache-control \"max-age=31536000\"",
"group": "build",
"problemMatcher": []
},
],
"inputs": [
{
"id" : "s3bucket",
"type" : "promptString",
"description" : "S3 bucket variable",
"default": "<enter-name-of-your-s3-bucket>",
}
]
}
@tomas-chudjak
Copy link
Author

tomas-chudjak commented May 6, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment