From 0501fedef894d11481ea420726c9bf1e14024f4f Mon Sep 17 00:00:00 2001 From: Oluwatobiloba Promise Temitope Date: Fri, 20 Nov 2026 16:02:22 +0200 Subject: [PATCH 1/2] use tipibot runner --- .gitea/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 9b641f8..6583296 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -7,7 +7,7 @@ on: jobs: deploy: name: Deploy to LXC - runs-on: lapbot + runs-on: tipibot-runner steps: - name: Check out code uses: actions/checkout@v4 From 4ea5ede5e63fac163a33813339cbd0c6ea8facb5 Mon Sep 17 00:00:00 2001 From: Oluwatobiloba Promise Temitope Date: Fri, 20 Nov 2026 16:03:48 +0200 Subject: [PATCH 2/2] ci(deploy): authenticate Gitea mirror with SSH --- .github/workflows/deploy.yml | 12 ++++++++++++ README.md | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 326beba..c530bdc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,6 +25,18 @@ jobs: with: fetch-depth: 0 + - name: Configure Gitea SSH + env: + GITEA_DEPLOY_KEY: ${{ secrets.GITEA_DEPLOY_KEY }} + GITEA_KNOWN_HOSTS: ${{ vars.GITEA_KNOWN_HOSTS }} + run: | + test -n "$GITEA_DEPLOY_KEY" + test -n "$GITEA_KNOWN_HOSTS" + install -m 700 -d ~/.ssh + printf '%s\n' "$GITEA_DEPLOY_KEY" > ~/.ssh/id_ed25519 + printf '%s\n' "$GITEA_KNOWN_HOSTS" > ~/.ssh/known_hosts + chmod 600 ~/.ssh/id_ed25519 ~/.ssh/known_hosts + - name: Push to Gitea env: GITEA_REMOTE: ${{ secrets.GITEA_REMOTE }} diff --git a/README.md b/README.md index 46ce924..5762775 100644 --- a/README.md +++ b/README.md @@ -180,8 +180,11 @@ As root, with PostgreSQL running: Private repo: set `LAPBOT_REMOTE` in the runner environment. Use an SSH URL, a read-only deploy key and configured known hosts. -7. On GitHub, add a `production` environment with the secret `GITEA_REMOTE`: - `https://:@git.lapikud.ee//lapbot.git`. +7. On Gitea, add the SSH public key as a repository deploy key with write + access. On GitHub, add a `production` environment with the private key as + `GITEA_DEPLOY_KEY`, the SSH URL as `GITEA_REMOTE` + (`git@git.lapikud.ee:Lapikud/lapbot.git`), and a verified `known_hosts` line + for `git.lapikud.ee` as the `GITEA_KNOWN_HOSTS` variable. 8. Push to `main`. The first deploy clones `/opt/lapbot/repo`. Logs: `journalctl -u lapbot`. Back up the database and `/opt/lapbot/logs`.