-
-
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
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
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