2024-02-17 13:48:09 +01:00
|
|
|
name: publish
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
SSH_PRIVATE_KEY: ${{ secrets.PUBLISHER_PRIVATE_KEY }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
fetch-depth: 0 # all history for all branches and tags\
|
|
|
|
|
|
|
|
- name: Install Hugo
|
|
|
|
run: |
|
2024-02-17 14:08:58 +01:00
|
|
|
apt update && apt install -y hugo
|
2024-02-17 13:48:09 +01:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
hugo --minify
|
|
|
|
|
|
|
|
- name: Deploy
|
|
|
|
run: |
|
|
|
|
eval $(ssh-agent -s)
|
|
|
|
echo "$SSH_PRIVATE_KEY" | ssh-add -
|
|
|
|
apt update && apt install -y rsync
|
|
|
|
mkdir ~/.ssh
|
2024-02-17 15:24:40 +01:00
|
|
|
ssh-keyscan 172.25.1.5 > ~/.ssh/known_hosts
|
|
|
|
rsync -atv --progress ./public/ publisher@172.25.1.5:/usr/var/nginx/html/
|