www/.forgejo/workflows/deploy.yml

32 lines
804 B
YAML

name: Deploy on webserver
defaults:
run:
# hugo container only has `sh`
shell: sh
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: Generate site
run: hugo
- name: Deploy BUT WHERETO?
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/