Skip to content

victoriadrake/hugo-latest-cd

Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

GitHub Action to build and deploy a Hugo site to GitHub Pages using latest extended Hugo πŸš€

This action cleans and rebuilds your Hugo site to a destination folder in the same repository.

It always uses the latest extended version from Hugo releases. The extended version enables the processing of SCSS and Sass files to CSS.

Your site will build in a destination folder in your repository, and that folder will be pushed back to master. To automatically serve your updated site with GitHub Pages, choose the docs/ folder as your source.

The default destination folder is docs/.

Add action to your workflow

Here is an example workflow file that uses this action on any push event to the master branch:

name: hugo-latest-cd

on:
  push:
    branches:
      - master

env:
  TOKEN: ${{ secrets.GITHUB_TOKEN }}
  #  HUGO_ARGS: '--minify'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - name: πŸ›Ž Check out master
        uses: actions/checkout@master
        with:
          fetch-depth: 1
      - name: πŸš€ Build and deploy
        uses: victoriadrake/hugo-latest-cd@master

You may uncomment the HUGO_ARGS env setting above to pass arbitrary options to the hugo build command. See man hugo on your system for options.

Use the workflow YAML file directly

If you prefer to place this action's YAML file in your repository directly, simply copy the included hugo-latest-cd.yml into your repository's .github/workflows/ directory.

For help editing the YAML file, see Workflow syntax for GitHub Actions.