Just the source for my homepage. Hosted on GitHub Pages.
This dev branch is the main branch . master is where the static site is hosted at GitHub Pages and is auto-generated from this branch.
Currently implemented in SvelteKit using npm.
!!DOCUMENTATION TO BE UPDATED!!
.github/workflows/pages.yml is a GitHub Action triggered by pushes to dev branch (except if the push is just README.md). The action does the following:
- checks-our the
devbranch - builds the
devbranch - clones
masterbranch - removes all local
mastercontent (to handle files possibly removed in the new build), keeping current gitmasterbranch state - puts artifacts from the
devbuild into the localmaster - commits and pushes
master
After pushing to master, a GitHub Pages Deploy action is triggered that processes these files and serves it to your GitHub Page.
Ran into quite a few hoops to get this working:
- user pages has to use
<username>.github.ioas the repo name - user pages are built from the
masterbranch root - it doesnt have to be .md files
- having
index.htmlandREADME.mdcauses problems - you need a
CNAMEfile with your desired domain if you'll use a custom domain - custom domains has to be an apex or subdomain, not a sub resource
- if you use a
CNAMEfile, you can't have the same CNAME in another repo in GitHub - GitHub Actions can run shell scripts. This may actually be more portable.
- At any error exit code the script will terminate and no longer proceed
- pushing to
masterwithGITHUB_TOKENfrom a workflow supposedly won't trigger GitHub Pages to build, so you'll need to generate a personal access token and use that for the git push tomasterto trigger the page build