www/.forgejo/workflows/deploy.yml
2025-12-02 14:18:47 +01:00

33 lines
881 B
YAML

name: Deploy on webserver
on:
push:
branches:
- main
jobs:
deploy:
name: Build site and deploy on success
runs-on: hugo-latest
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
- name: Deploy
run: mv public /www/www-draft.distribits.live && mv /www/www.distribits.live /www/old_www-draft.distribits.live; mv /www/www-draft.distribits.live /www/www.distribits.live; rm -rf /www/old_www-draft.distribits.live/