website/.forgejo/workflows/build.yaml

51 lines
1.5 KiB
YAML
Raw Normal View History

name: build-to-pages
on: [push]
branches: [main]
jobs:
build:
runs-on: docker
env:
HUGO_VERSION: 0.115.4
steps:
- name: Install Hugo CLI
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
- name: Install Dart Sass
run: npm i -g sass
- run: sass --version
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: hugo --minify
2023-10-28 19:32:32 +00:00
- name: Zip output
run: apt update && apt install zip -y && zip -r public.zip public/
- uses: actions/upload-artifact@v3
with:
name: hugo-output
2023-10-28 19:32:32 +00:00
path: ./public.zip
if-no-files-found: error
2023-10-28 19:36:38 +00:00
retention-days: 1
push:
runs-on: docker
steps:
- uses: actions/checkout@v4
with:
ref: public
- run: rm -rf *
- uses: actions/download-artifact@v3
with:
name: hugo-output
2023-10-28 19:36:38 +00:00
- run: apt update && apt install unzip -y && unzip hugo-output/public.zip -d .
- run: rm -rf hugo-output && ls -l
- run: |
git config user.name "forgejo-actions"
git config user.email ""
git add .
git commit -m "generated"
git push