web-personal/.forgejo/workflows/build.yaml
Marc Riera 435e8c2fbc
All checks were successful
publish / publish (push) Successful in 24s
Update publisher
2024-12-20 11:44:31 +01:00

36 lines
932 B
YAML

name: publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-24.04
env:
SSH_USER: ${{ secrets.PUBLISHER_USER }}
SSH_PRIVATE_KEY: ${{ secrets.PUBLISHER_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.PUBLISHER_HOST }}
SSH_PORT: ${{ secrets.PUBLISHER_PORT }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # all history for all branches and tags\
- name: Install Hugo
run: |
apt update && apt install -y hugo
- name: Build
run: |
hugo --minify
- name: Deploy
run: |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | ssh-add -
apt update && apt install -y rsync
ssh-keyscan -p $SSH_PORT $SSH_HOST > ~/.ssh/known_hosts
rsync -atv --progress --delete -e "ssh -p $SSH_PORT" ./public/ $SSH_USER@$SSH_HOST:/app