53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Build and Deploy Hugo Site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- preview
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout source
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0 # needed for .GitInfo and lastmod
|
|
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v3
|
|
with:
|
|
hugo-version: 'latest'
|
|
extended: false
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Build site
|
|
run: hugo --minify --gc
|
|
|
|
- name: Build and Deploy (Live - master)
|
|
if: github.ref == 'refs/heads/master'
|
|
run: |
|
|
echo "Building site for live (help.ats4all.com)..."
|
|
hugo --minify --gc -b "https://help.ats4all.com"
|
|
echo "Deploying to /deploy-live ..."
|
|
rm -rf /deploy-live/*
|
|
cp -a public/. /deploy-live/
|
|
echo "Live deploy complete."
|
|
|
|
- name: Build and Deploy (Preview - preview)
|
|
if: github.ref == 'refs/heads/preview'
|
|
run: |
|
|
echo "Building site for preview (testweb.ats4all.com)..."
|
|
hugo --minify --gc -D -b "https://testweb.ats4all.com"
|
|
echo "Deploying to /deploy-preview ..."
|
|
rm -rf /deploy-preview/*
|
|
cp -a public/. /deploy-preview/
|
|
echo "Preview deploy complete."
|