Add a forgejo deploy action #7
1 changed files with 33 additions and 0 deletions
33
.forgejo/workflows/deploy.yml
Normal file
33
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Deploy on webserver
|
||||
|
||||
defaults:
|
||||
run:
|
||||
# hugo container only has `sh`
|
||||
shell: sh
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- trunk
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
if: github.repository_owner == "www"
|
||||
name: Build site with hugo and deploy on success
|
||||
runs-on: psyinf-hugo-site-build
|
||||
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_file_content: false
|
||||
|
||||
- name: Generate site
|
||||
run: hugo
|
||||
|
||||
- name: Deploy
|
||||
run: cp -r public /www/_rdm.sfb1451.de && rm -rf /www/rdm.sfb1451.de ; mv /www/_rdm.sfb1451.de /www/rdm.sfb1451.de
|
||||
Loading…
Add table
Add a link
Reference in a new issue