Use production host runner for deployment
Deploy TodoList / deploy (push) Successful in 3s

This commit is contained in:
2026-07-27 07:52:16 +00:00
parent 2690088423
commit 1e142f1de4
+7 -39
View File
@@ -8,54 +8,22 @@ on:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: todolist-production
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
- name: Verify runner prerequisites - name: Verify production runner
shell: bash shell: bash
run: | run: |
set -Eeuo pipefail set -Eeuo pipefail
command -v bash >/dev/null
command -v ssh >/dev/null test "$(id -un)" = "scaiuser"
command -v base64 >/dev/null test -x /home/scaiuser/dwh_apps/fastapi-todolist/scripts/ci-deploy-entrypoint.sh
systemctl --user is-active todolist-gitea-runner.service
- name: Deploy production - name: Deploy production
shell: bash shell: bash
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_SSH_KEY_B64: ${{ secrets.DEPLOY_SSH_KEY_B64 }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
run: | run: |
set -Eeuo pipefail set -Eeuo pipefail
umask 077
test -n "$DEPLOY_HOST" /home/scaiuser/dwh_apps/fastapi-todolist/scripts/ci-deploy-entrypoint.sh
test -n "$DEPLOY_PORT"
test -n "$DEPLOY_USER"
test -n "$DEPLOY_SSH_KEY_B64"
test -n "$DEPLOY_KNOWN_HOSTS"
SSH_DIR="$(mktemp -d)"
trap 'rm -rf -- "$SSH_DIR"' EXIT HUP INT TERM
printf '%s' "$DEPLOY_SSH_KEY_B64" |
base64 --decode > "$SSH_DIR/id_ed25519"
printf '%s\n' "$DEPLOY_KNOWN_HOSTS" \
> "$SSH_DIR/known_hosts"
chmod 600 "$SSH_DIR/id_ed25519"
chmod 600 "$SSH_DIR/known_hosts"
ssh \
-p "$DEPLOY_PORT" \
-i "$SSH_DIR/id_ed25519" \
-o BatchMode=yes \
-o IdentitiesOnly=yes \
-o StrictHostKeyChecking=yes \
-o UserKnownHostsFile="$SSH_DIR/known_hosts" \
"$DEPLOY_USER@$DEPLOY_HOST" \
/home/scaiuser/dwh_apps/fastapi-todolist/scripts/ci-deploy-entrypoint.sh