From 69be043f9d2524a28e5665556671b22625261a54 Mon Sep 17 00:00:00 2001 From: David Dyer Date: Sun, 25 Oct 2026 19:45:30 -0400 Subject: [PATCH] Add deployment step to GitHub Actions workflow for Docker host --- .gitea/workflows/build.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 06d435a..c4a1732 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -65,3 +65,19 @@ jobs: - name: Push run: docker push --all-tags "$IMAGE" + + # Redeploy on the Docker host. The key's forced command on the host + # only accepts allowlisted site names, so this can't run anything else. + # Skipped when DEPLOY_HOST isn't set. + - name: Deploy + if: ${{ vars.DEPLOY_HOST != '' }} + env: + DEPLOY_HOST: ${{ vars.DEPLOY_HOST }} + DEPLOY_KNOWN_HOSTS: ${{ vars.DEPLOY_KNOWN_HOSTS }} + DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + run: | + install -m 700 -d ~/.ssh + printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key + chmod 600 ~/.ssh/deploy_key + printf '%s\n' "$DEPLOY_KNOWN_HOSTS" > ~/.ssh/known_hosts + ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=yes "root@$DEPLOY_HOST" theoldfitz