Skip to content

Build Hugo site from push #28

Build Hugo site from push

Build Hugo site from push #28

Workflow file for this run

name: Build Hugo site from push
on:
push:
branches:
- main
# SCHEDULE AND WORKFLOW DISPATCH ARE FOR TESTING
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
HUGO_SOURCE_DIR: "."
HUGO_BASE_URL: ""
HUGO_OUTPUT_DIR: "public"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build site
uses: omsf/static-site-tools/build/hugo@main
with:
base-url: ${{ env.HUGO_BASE_URL }}
source-directory: ${{ env.HUGO_SOURCE_DIR }}
output-directory: ${{ env.HUGO_OUTPUT_DIR }}
- name: Make artifact
shell: bash
run: tar czf site.tar.gz -C ${{ env.HUGO_SOURCE_DIR }} ${{ env.HUGO_OUTPUT_DIR }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: site-build
path: site.tar.gz
if-no-files-found: error
retention-days: 1