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:43:31 +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:42:49 +00:00
|
|
|
run: |
|
|
|
|
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
|
|
|
|
&& dpkg -i ${{ runner.temp }}/hugo.deb
|
2023-10-22 19:26:55 +00:00
|
|
|
- name: Install Dart Sass
|
2023-10-22 19:42:49 +00:00
|
|
|
run: snap install dart-sass
|
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
|