Publishing with Pages

GitHub can host static webpages for free with their Pages-Service. This is how I host most of my websites and apps.

React App

Add the homepage url to the package.json. When building with a Pages-Action this will be used to generate the path to the files referenced in the index.html

"homepage": "https://muensterer.xyz/%repository-name%",
# ./github/workflows/pages.yml
name: React app deployment

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Deploy react app to github pages
      uses: tanwanimohit/deploy-react-to-ghpages@v1.0.1

Remember to activate the pages feature in the project settings!

DNS Config

  1. Add/Update CNAME
  2. Add A-Records
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153

Verification

https://github.com/settings/pages