Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitea/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<user>:<token>@git.lapikud.ee/<owner>/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`.
Loading