Skip to content

Powerful Hugo action for simple and advanced use cases.

License

Notifications You must be signed in to change notification settings

floryn90/actions-hugo

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

Hugo Action

Easy to use action to build your Hugo homepage using the floryn90/hugo Docker images made available.

Getting started

Your workflow is written in e.g. .github/workflows/hugo.yml.

Simple workflow example using the latest and lightest image:

name: Hugo

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: hugo
      uses: floryn90/[email protected]

More advanced workflow example using matrix with multiple versions and image types:

name: Hugo

on: [push]

jobs:
  build:
    strategy:
      matrix:
        version: [0.56.3, 0.57.2]
        image: [busybox, alpine]

    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: hugo
      uses: floryn90/[email protected]
      with:
        version: ${{ matrix.version }}
        image: ${{ matrix.image }}

Configuration

version - Sets the version of Hugo to be used during build. Defaults to blank when not set, resulting in using the very latest version.

image - Sets the image type used. Defaults to busybox when not set. The following are available for most versions (ext indicate extended edition):

  • busybox
  • alpine
  • debian
  • ubuntu
  • ext-alpine
  • ext-debian
  • ext-ubuntu

source - Sets the source directory to be used. Defaults to blank, expecting Hugo config file to be at the root of your repository.

target - Sets the target directory to be used. Defaults to public.

command - Sets the command to be used. Defaults to blank. When set is normal Hugo commands used, however hugo is skipped.

pandoc_command - Sets the Pandoc command used. Defaults to pandoc-default. See use of Pandoc with Hugo for more information.

env - Sets the Hugo environemt. Defaults to DEV. Possible values:

  • DEV
  • production

About

Powerful Hugo action for simple and advanced use cases.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%