Last active
January 14, 2019 08:42
-
-
Save jhawthorn/e66e24ef0592fdf8d0c8a3f4dd25161d to your computer and use it in GitHub Desktop.
GitHub actions workflow for my static site https://github.com/jhawthorn/site-example for more
This file contains 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
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