2023-10-20 20:53:21 +00:00
|
|
|
name: build-to-pages
|
|
|
|
on: [push]
|
|
|
|
branches: [main]
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-10-21 19:08:09 +00:00
|
|
|
runs-on: docker
|
2023-10-22 19:26:55 +00:00
|
|
|
#env:
|
|
|
|
# HUGO_VERSION: 0.115.4
|
2023-10-20 20:53:21 +00:00
|
|
|
steps:
|
2023-10-22 19:13:02 +00:00
|
|
|
- name: Install Hugo CLI
|
2023-10-22 19:31:49 +00:00
|
|
|
run: apt update && apt install hugo -y
|
2023-10-22 19:26:55 +00:00
|
|
|
- name: Install Dart Sass
|
2023-10-21 19:39:07 +00:00
|
|
|
# run: sudo snap install dart-sass
|
2023-10-22 19:31:49 +00:00
|
|
|
run: hugo version
|
2023-10-21 19:41:58 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-10-21 18:54:48 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2023-10-21 19:04:14 +00:00
|
|
|
- name: Build with Hugo
|
|
|
|
env:
|
|
|
|
# For maximum backward compatibility with Hugo modules
|
|
|
|
HUGO_ENVIRONMENT: production
|
|
|
|
HUGO_ENV: production
|
|
|
|
run: hugo --minify
|
2023-10-21 18:54:48 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: hugo-output
|
|
|
|
path: ./public
|
|
|
|
if-no-files-found: error
|
2023-10-20 20:53:21 +00:00
|
|
|
push:
|
2023-10-21 19:08:09 +00:00
|
|
|
runs-on: docker
|
2023-10-20 20:53:21 +00:00
|
|
|
steps:
|
2023-10-21 19:41:58 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-10-21 18:54:48 +00:00
|
|
|
with:
|
|
|
|
ref: pages
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: hugo-output
|
|
|
|
- run: ls -l
|
2023-10-20 20:53:21 +00:00
|
|
|
- run: |
|
|
|
|
git config user.name "forgejo-actions"
|
|
|
|
git config user.email ""
|
|
|
|
git add .
|
|
|
|
git commit -m "generated"
|
|
|
|
git push
|