Skip to content

tehdarthvid/tehdarthvid.github.io

Repository files navigation

homepage

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

Automation

GitHub Pages Deploy

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

  1. checks-our the dev branch
  2. builds the dev branch
  3. clones master branch
  4. removes all local master content (to handle files possibly removed in the new build), keeping current git master branch state
  5. puts artifacts from the dev build into the local master
  6. 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.

Learnings

Ran into quite a few hoops to get this working:

  1. user pages has to use <username>.github.io as the repo name
  2. user pages are built from the master branch root
  3. it doesnt have to be .md files
  4. having index.html and README.md causes problems
  5. you need a CNAME file with your desired domain if you'll use a custom domain
  6. custom domains has to be an apex or subdomain, not a sub resource
  7. if you use a CNAME file, you can't have the same CNAME in another repo in GitHub
  8. GitHub Actions can run shell scripts. This may actually be more portable.
  9. At any error exit code the script will terminate and no longer proceed
  10. pushing to master with GITHUB_TOKEN from 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 to master to trigger the page build

About

homepage (see README.md in "dev" branch)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors