From 9beaf0dde195fd2be1ef3a43a2671785735450e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Balv=C3=ADn?= Date: Sun, 26 Jul 2026 14:12:23 +0200 Subject: [PATCH] ci(deploy): add Gitea workflow for main branch deployment --- .gitea/workflows/deploy.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..64931b7 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,36 @@ +name: Deploy + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + deploy: + runs-on: fedora:latest + steps: + - uses: actions/checkout@v4 + + - name: Install deployment tools + run: | + dnf install -y sshpass rsync + + - name: Generate SHA256SUMS + run: sha256sum *.py > SHA256SUMS + + - name: Deploy via rsync + timeout-minutes: 3 + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} + DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }} + run: | + set -euo pipefail + echo "Deploying to ${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}" + + sshpass -p "$DEPLOY_PASSWORD" rsync -avz --delete \ + -e "ssh -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/dev/null" \ + *.py SHA256SUMS "${DEPLOY_USER}@${DEPLOY_HOST}:${DEPLOY_PATH}" + + echo "Deploy complete."