This project sets custom domains for GitHub Pages of the repositories, including creating them in AWS Route53.
- AWS Account
- A Hosted Zone in AWS for the domain you chose to use
- Fork this repository
- Set the following Secrets in your the forked GitHub repository (Encrypted Secrets):
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
to an access key of your AWS accountAWS_REGION
to an AWS region you chose to useGH_ACCESS_TOKEN
to a GitHub Personal Access Token withrepo
scope set
- Update
settings.json
with your account name and domain to use (repositories should be empty or ignored, the scripts will overwrite it) - IMPORTANT Update stack name in
bin/aws-github-pages.ts
to make it unique - Run the
Deploy
action when you wish, which will:- Read all your repositories and collect all public and owned ones that have GitHub Pages enabled or has
gh-pages
branch - Deploy the necessary
CNAME
records to the domain's hosted zone in AWS
(i.e.CNAME {repository-name}.{domain}
to{account}.github.io
) - Updates the repositories:
- Enables pages if it is not enabled yet and there is a
gh-pages
branch - Sets custom domain for the pages
- Waits for HTTPS certificate for the custom domain and enabled HTTPS enforced
- Sets home page for the repository
- Enables pages if it is not enabled yet and there is a
- Read all your repositories and collect all public and owned ones that have GitHub Pages enabled or has