Skip to content

Hugo for GitHub Pages

Actions
Builds and deploys the project to GitHub Pages
v0.0.2
Latest
Star (3)

Hugo Github Action

GitHub Action for building and publishing Hugo-built site.

Inspired by khanhicetea/gh-actions-hugo-deploy-gh-pages

This GitHub Action allows you to deploy your Hugo git repo into another one.

Secrets

  • GIT_DEPLOY_KEY - Required your deploy key which has Write access

Create Deploy Key

  1. Generate deploy key ssh-keygen -t rsa -f hugo -q -N ""
  2. Then go to "Settings > Deploy Keys" of repository
  3. Add your public key within "Allow write access" option.
  4. Copy your private deploy key to GIT_DEPLOY_KEY secret in "Settings > Secrets"

Environment Variables

  • HUGO_VERSION : optional, default is 0.54.0 - check all versions here
  • WEBSITE_GIT : required, the website git repo which you want to deploy
  • WEBSITE_DIR : required, the directory which your website git repo will clone into
name: Deploy to GitHub Pages

on:
  push:
    branches:
    - master

jobs:
  hugo-deploy-gh-pages:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: hugo-deploy-gh-pages
      uses: linuxsuren/surenpi@master
      env:
        GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
        HUGO_VERSION: "0.53"
        WEBSITE_GIT: "git@github.com:LinuxSuRen/linuxsuren.github.io.git"
        WEBSITE_DIR: "linuxsuren.github.io"

Hugo for GitHub Pages is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Builds and deploys the project to GitHub Pages
v0.0.2
Latest

Hugo for GitHub Pages is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.