2024-09-08 21:37:08 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-09-08 21:37:56 +00:00
|
|
|
- master
|
2024-09-08 21:37:08 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: debian-testing-slim
|
|
|
|
steps:
|
2024-09-08 21:46:15 +00:00
|
|
|
- name: Update system and install deps
|
2024-09-08 21:37:08 +00:00
|
|
|
env:
|
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
run: |
|
|
|
|
apt-get update
|
2024-09-08 23:04:16 +00:00
|
|
|
apt-get install -y hugo rsync openssh-client nodejs
|
|
|
|
- name: Clone repository
|
|
|
|
uses: https://gitea.com/actions/checkout@v4
|
2024-09-08 23:20:05 +00:00
|
|
|
- name: Initialize submodules
|
|
|
|
run: |
|
|
|
|
git submodule init
|
|
|
|
git submodule update
|
2024-09-08 21:37:08 +00:00
|
|
|
- name: Setup SSH
|
|
|
|
env:
|
|
|
|
SSH_KEY: ${{ secrets.ssh_key }}
|
|
|
|
run: |
|
|
|
|
mkdir ~/.ssh/
|
|
|
|
printf '%s\n' "${SSH_KEY}" > ~/.ssh/id_rsa
|
|
|
|
chmod 0700 ~/.ssh
|
|
|
|
chmod 0700 ~/.ssh/id_rsa
|
2024-09-14 22:48:05 +00:00
|
|
|
- name: Prepare modules
|
|
|
|
run: /usr/bin/hugo mod get -u
|
2024-09-08 21:37:08 +00:00
|
|
|
- name: Run Hugo
|
2024-09-08 23:20:05 +00:00
|
|
|
run: /usr/bin/hugo --logLevel info
|
2024-09-08 21:37:08 +00:00
|
|
|
- name: Run rsync
|
|
|
|
env:
|
|
|
|
SSH_PORT: ${{ secrets.ssh_port }}
|
|
|
|
run: /usr/bin/rsync --verbose --compress --archive --recursive --progress --checksum --delete --rsh="/usr/bin/ssh -4 -p ${SSH_PORT} -o StrictHostKeyChecking=no" public/ blog@sergiodj.net:.
|