website/.forgejo/workflows/build.yaml
Hoernschen afebbdbd3d
Some checks failed
build-to-pages / build (push) Successful in 15s
build-to-pages / push (push) Failing after 8s
FIX pipeline
2023-12-24 00:20:01 +01:00

56 lines
No EOL
1.7 KiB
YAML

name: build-to-pages
on: [push]
branches: [main]
jobs:
build:
runs-on: docker
container:
image: node:latest
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
- 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
- name: Zip output
run: apt update && apt install zip -y && zip -r public.zip public/
- uses: actions/upload-artifact@v3
with:
name: hugo-output
path: ./public.zip
if-no-files-found: error
retention-days: 1
push:
runs-on: docker
container:
image: node:latest
steps:
- uses: actions/checkout@v4
with:
ref: public
- name: Clean current files in directory
run: rm -rf *
- uses: actions/download-artifact@v3
with:
name: hugo-output
- name: Unzip hugo output
run: apt update && apt install unzip -y && unzip public.zip -d . && shopt -s dotglob && mv ./public/* ./
- name: Publish
run: |
git config user.name "forgejo-actions"
git config user.email ""
git add .
git commit -m "generated"
git push