www-from-model/.forgejo/workflows/deploy.yml
Michael Hanke b154b7054f
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 1m14s
ci: dedicated deployment step for the official website branch
This follows the established model used for TRR379 and distribits.
2026-05-18 11:07:39 +02:00

51 lines
1.7 KiB
YAML

name: Deploy on webserver
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
name: Build site and deploy on success
runs-on: site-deploy
container:
volumes:
# for depositing the built site directly
- /home/www/srv:/www:rw
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install tools
run: |
uv tool install git-annex
- name: git-annex init
run: |
git fetch --depth 1 origin git-annex:git-annex
git config --add annex.private true
git annex init
- name: Fetch theme
run: |
git submodule update --init --depth 1 -- themes/congo
- name: Get annex'ed content
run: |
git annex get .
- name: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v3
with:
hugo-version: '0.154.5'
extended: true
- name: Generate site
run: hugo --minify
- name: Deploy official site
if: ${{ github.ref_name == 'published' }}
run: mv public /www/new_www.psychoinformatics.de && mv /www/www.psychoinformatics.de /www/old_www.psychoinformatics.de; mv /www/new_www.psychoinformatics.de /www/www.psychoinformatics.de; rm -rf /www/old_www.psychoinformatics.de/
- name: Deploy draft site
if: ${{ github.ref_name == 'main' }}
run: mv public /www/new_www-draft.psychoinformatics.de && mv /www/www-draft.psychoinformatics.de /www/old_www-draft.psychoinformatics.de; mv /www/new_www-draft.psychoinformatics.de /www/www-draft.psychoinformatics.de; rm -rf /www/old_www-draft.psychoinformatics.de/