Skip to content

Instantly share code, notes, and snippets.

@oliviergimenez
Created August 3, 2021 15:04
Show Gist options
  • Save oliviergimenez/bb8f87f352b0a358e5b40911acaaa16a to your computer and use it in GitHub Desktop.
Save oliviergimenez/bb8f87f352b0a358e5b40911acaaa16a to your computer and use it in GitHub Desktop.
Github action to build and deploy Hugo website
name: Build and Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: macos-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.79.1'
extended: true
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.HUGO_WEBSITE_BUILDEPLOY }}
external_repository: oliviergimenez/oliviergimenez.github.io
publish_dir: ./public
publish_branch: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment