docs.trr379.de/.forgejo/workflows/deploy.yml
Michael Hanke 2329df21b4
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 10m8s
New deployment approach
Use hugo setup action, rather than a custom container. This is faster
(hugo is a static binary), and there is much less to maintain.
2025-12-10 07:59:20 +01:00

33 lines
869 B
YAML

name: Deploy on webserver
on:
push:
branches:
- main
jobs:
deploy:
name: Build site and deploy on success
runs-on: trr379-www-deposit
container:
volumes:
# for depositing the built site directly
- /home/www/srv:/www:rw
steps:
- name: Checkout
uses: https://hub.datalad.org/forgejo/datalad-clone-action@v1
with:
recursive: true
get_content: .
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v3
with:
hugo-version: '0.146.0'
extended: true
- name: Generate site
run: hugo --minify
- name: Deploy official site
run: cp -r public /www/new_docs.trr379.de && mv /www/docs.trr379.de /www/old_docs.trr379.de; mv /www/new_docs.trr379.de /www/docs.trr379.de; rm -rf /www/old_docs.trr379.de/