Building and deploying a custom site using GitHub Actions and GitHub Pages
Published on: 2025-06-07 21:13:39
Building and deploying a custom site using GitHub Actions and GitHub Pages
I figured out a minimal pattern for building a completely custom website using GitHub Actions and deploying the result to GitHub Pages.
First you need to enable GitHub Pages for the repository. Navigate to Settings -> Pages (or visit $repo/settings/pages ) and set the build source to "GitHub Actions".
Here's my minimal YAML recipe - save this in a .github/workflows/publish.yml file:
name : Publish site on : push : workflow_dispatch : permissions : pages : write id-token : write jobs : build : runs-on : ubuntu-latest steps : - uses : actions/checkout@v4 - name : Build the site run : | mkdir _site echo '