Skip to content

Instantly share code, notes, and snippets.

@thbar
Forked from jhawthorn/main.workflow
Created January 14, 2019 08:42
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 thbar/8376838d27764037945ab3ef2590a91e to your computer and use it in GitHub Desktop.
Save thbar/8376838d27764037945ab3ef2590a91e to your computer and use it in GitHub Desktop.
GitHub actions workflow for my static site https://github.com/jhawthorn/site-example for more
workflow "Build and deploy on push" {
on = "push"
resolves = [
"Branch master",
"Invalidate cache",
]
}
action "Build" {
uses = "docker://ruby:latest"
env = {
LANG = "C.UTF-8"
}
runs = "bin/build"
}
action "Deploy" {
uses = "actions/aws/cli@master"
needs = ["Branch master"]
args = "s3 sync --delete --acl public-read ./build/ s3://www.johnhawthorn.com/ "
secrets = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"]
}
action "Branch master" {
uses = "actions/bin/filter@master"
needs = ["Build"]
args = "branch master"
}
action "Invalidate cache" {
uses = "actions/aws/cli@master"
needs = ["Deploy"]
args = "cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths \"/*\""
secrets = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "CF_DISTRIBUTION_ID"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment