From e033fa3d4b8329d134f5f6cbc45b251f67dbc9dc Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 8 Sep 2024 17:37:08 -0400 Subject: [PATCH] Add Forgejo runner yaml --- .forgejo/workflows/deploy.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .forgejo/workflows/deploy.yaml diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml new file mode 100644 index 0000000..fdf0b7e --- /dev/null +++ b/.forgejo/workflows/deploy.yaml @@ -0,0 +1,29 @@ +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: debian-testing-slim + steps: + - name: Update systemand install deps + env: + DEBIAN_FRONTEND=noninteractive + run: | + apt-get update + apt-get install -y hugo rsync openssh-client + - 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 + - name: Run Hugo + run: /usr/bin/hugo --verbose + - 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:.