Skip to content

CDK support for deploying a hugo static site with CI/CD

License

Notifications You must be signed in to change notification settings

ahammond/hugo-cdk

Repository files navigation

License codecov release

Hugo CDK

Connect a github repository to an AWS CodeBuild so that it does HUGO builds of that repo on every PR. When master is updated, have it deploy that code to an AWS static site.

Usage

Assumes you have an AWS account with a profile configured as "personal". If you only have one AWS account in your life, cool. Get the CLI client working and then remove the --profile personal from all the commands below. Otherwise, use the appropriate profile. Splitting things to separate CI, Staging and Prod accounts is beyond the scope of this README.

Next, edit bin/app.ts, and tweak the siteNames, siteDomain, and put in your own accountId and github info.

Go to AWS CodeBuild, create a project, link it to github using oauth. Click throught the process until you have the oauth link setup. You only need to do this one per AWS account. You don't need to save or even complete the resulting CodeBuild project.

# install the library dependencies
npm install
# compile
npm run build
# You only need to run this once for each account you're using CDK with.
npx cdk --profile personal bootstrap
# Make sure you've already pushed the github repo that contains the site.
# Deploy all the things.
npx cdk --profile personal deploy \*

Coverage

coverage

About

CDK support for deploying a hugo static site with CI/CD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published