You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go to https://github.com/{your_user_name}/{your_repo_name}/settings/pages
Under Build and Deployment, change the dropdown from Deploy from Branch to Github Actions
Whilst we are here tick the box for Enforce HTTPS.
You will be presented with two premade Github Action Templates, choose the Static HTML option by clicking it's Configure button.
This will open an edit screen for .github/workflows/static.yml. No need to make changes, simply click Commit Changes and again when the box pops up asking for a commit message.
2. Create Content
create a index.html, styles.css and scripts.js in the root of the repo.
Look at the content of this example repo for the specifics.
3. Deployment
Every time you commit to main or merge code to main, the Github Action takes a copy of your code and publishes it to Github's CDN caches.
Details of each run are at: https://github.com/{your_user_name}/{your_repo_name}/actions/workflows/static.yml
It will deploy to https://{your_user_name}.github.io/{your_repo_name} so that you can have a website for every repo / project you have.
4. Your personal blog
If you name a repo {your_user_name}.github.io and publish a Github Pages deployment, that one is special and will deploy to https://{your_user_name}.github.io/
There is plenty of documentation on how to associate a custom domain name to replace the {your_user_name}.github.io with yourdomain.com.