Find Related products on Amazon

Shop on Amazon

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 '

Hello, world!

' > _site/index.html - name : Upload artifact uses : actions/upload-pages-artifact@v3 deploy : environment : name : github-pages url : ${{ steps.deployment.outputs.page_url }} runs-on : ubuntu-latest needs : build steps : - name : Deploy to GitHub Pages id : deployment uses : actions/deplo ... Read full article.