From fc648094fa148286cc2ccfdb9f60171e12270e5a Mon Sep 17 00:00:00 2001 From: Oluwatobiloba Promise Temitope Date: Fri, 20 Nov 2026 16:21:02 +0200 Subject: [PATCH] ci(deploy): use Gitea HTTPS deploy token --- .github/workflows/deploy.yml | 13 +------------ README.md | 9 ++++----- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c530bdc..185fd0b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,7 @@ jobs: name: CI uses: ./.github/workflows/ci.yml + # git.lapikud.ee runs the actual deploy (.gitea/workflows/deploy.yml) from inside the network. mirror: name: Push main to Gitea needs: check @@ -25,18 +26,6 @@ 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 5762775..be569b6 100644 --- a/README.md +++ b/README.md @@ -180,11 +180,10 @@ 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 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. +7. In the Gitea repository, create an HTTPS deploy token with write access + (disable read-only). On GitHub, add a `production` environment with a + `GITEA_REMOTE` secret containing + `https://:@git.lapikud.ee//lapbot.git`. 8. Push to `main`. The first deploy clones `/opt/lapbot/repo`. Logs: `journalctl -u lapbot`. Back up the database and `/opt/lapbot/logs`.