Skip to content

Hugo Build and Archive #62

Hugo Build and Archive

Hugo Build and Archive #62

name: Hugo Build and Archive
on:
push:
branches:
- main
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.110.0"
extended: true
- name: Install Node.js Dependencies
run: npm install
working-directory: ${{ github.workspace }}
- name: Build Hugo Site
run: hugo --minify
- name: Archive Public Folder
run: |
zip -r public.zip public
working-directory: ${{ github.workspace }}
- name: Upload Archive
uses: actions/upload-artifact@v2
with:
name: public-archive
path: public