Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

deployment

Vincent Tam edited this page Mar 8, 2021 · 2 revisions

Please refer to Hosting & Deployment for details.

GitHub Actions

ℹ️ Note that this theme has to be built with Hugo extended, so you have to uncomment the line extended: true in the sample workflow.

name: github pages

on:
  push:
    branches:
      - main  # Set a branch to deploy

jobs:
  deploy:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true  # Fetch Hugo themes (true OR recursive)
          fetch-depth: 0    # Fetch all history for .GitInfo and .Lastmod

      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
        with:
          hugo-version: 'latest'
          extended: true    # Use extended Hugo

      - name: Build
        run: hugo --minify

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./public

GitLab CI/CD

The Docker image monachus/hugo uses Hugo extended, so you can use the sample CI/CD config file. You may configure the value of only to the branch containing the source code for your site.

image: monachus/hugo

variables:
  GIT_SUBMODULE_STRATEGY: recursive

pages:
  script:
  - hugo
  artifacts:
    paths:
    - public
  only:
  - master
Clone this wiki locally