This is a GitHub Action to deploy your static files to GitHub Pages
This deploy action can be combined simply and freely with Static Site Generators. (Hugo, MkDocs, Gatsby, mdBook, Next, Nuxt, and so on.)
The next example step will deploy ./public directory to the remote gh-pages branch.
For newbies of GitHub Actions:
Note that the GITHUB_TOKEN is NOT a personal access token.
A GitHub Actions runner automatically creates a GITHUB_TOKEN secret to authenticate in your workflow.
So, you can start to deploy immediately without any configuration.
GitHub Actions for Hugo ⚡️ Setup Hugo quickly and build your site fast. Hugo extended, Hugo Modules, Linux (Ubuntu), macOS, and Windows are supported.
GitHub Actions for Hugo
This Hugo Setup Action can install Hugo to a virtual machine of GitHub ActionsHugo extended version, Hugo Modules, Linux (Ubuntu), macOS, and Windows are supported.
From v2, this Hugo Setup Action has migrated to a JavaScript (TypeScript) action
We no longer build or pull a Hugo docker image.
Thanks to this change, we can complete this action in less than a few seconds.
(A docker base action was taking about 1 min or more execution time to build and pull a docker image.)
name:github pageson:push:branches:-mainpull_request:jobs:deploy:runs-on:ubuntu-22.04concurrency:group:${{ github.workflow }}-${{ github.ref }}steps:-uses:actions/checkout@v4with:submodules:true# Fetch Hugo themesfetch-depth:0# Fetch all history for .GitInfo and .Lastmod-name:Setup Hugouses:peaceiris/actions-hugo@v3with:hugo-version:'0.85.0'-name:Buildrun:hugo --minify-name:Deployuses:peaceiris/actions-gh-pages@v4if:${{ github.ref == 'refs/heads/main' }}with:github_token:${{ secrets.GITHUB_TOKEN }}publish_dir:./public
name:github pageson:push:branches:-mainpull_request:jobs:deploy:runs-on:ubuntu-22.04concurrency:group:${{ github.workflow }}-${{ github.ref }}steps:-uses:actions/checkout@v4-name:Setup Nodeuses:actions/setup-node@v4with:node-version:'14'-name:Setup Elmrun:npm install elm --global-name:Makerun:elm make --optimize src/Main.elm-name:Move filesrun:|mkdir ./publicmv ./index.html ./public/# If you have non-minimal setup with some assets and separate html/js files,# provide --output=<output-file> option for `elm make` and remove this step-name:Deployuses:peaceiris/actions-gh-pages@v4if:${{ github.ref == 'refs/heads/main' }}with:github_token:${{ secrets.GITHUB_TOKEN }}publish_dir:./public
⭐️ github/personal-website
github/personal-website - Code that'll help you kickstart a personal website that showcases your work as a software developer.
# .github/workflows/github-pages.ymlname:GitHub Pageson:push:branches:-masterschedule:-cron:'24*/24***'# Once a dayjobs:deploy:runs-on:ubuntu-22.04concurrency:group:${{ github.workflow }}-${{ github.ref }}steps:-uses:actions/checkout@v4-name:Deploy to GitHub Pagesuses:peaceiris/actions-gh-pages@v4with:github_token:${{ secrets.GITHUB_TOKEN }}publish_dir:./allow_empty_commit:trueenable_jekyll:truecname:github.peaceiris.com