Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50a13447a4 | ||
|
|
ce34d2c75f | ||
|
|
d394ac454b |
@@ -103,7 +103,7 @@ jobs:
|
||||
# PROD_USER — SSH login user (typically root)
|
||||
# PROD_SSH_KEY — private key whose public half is in authorized_keys
|
||||
# PROD_SSH_KNOWN_HOSTS — output of: ssh-keyscan -H <PROD_HOST>
|
||||
deploy:
|
||||
deploy-prod:
|
||||
name: Deploy to prod
|
||||
runs-on: ubuntu-latest
|
||||
needs: [docker]
|
||||
@@ -132,6 +132,43 @@ jobs:
|
||||
doppler run -- docker compose pull backend runner ui caddy pocketbase
|
||||
doppler run -- docker compose up -d --remove-orphans'
|
||||
|
||||
# ── deploy homelab runner ─────────────────────────────────────────────────────
|
||||
# Syncs the homelab runner compose file and restarts the runner service.
|
||||
#
|
||||
# Required Gitea secrets:
|
||||
# HOMELAB_HOST — homelab server IP (192.168.0.109)
|
||||
# HOMELAB_USER — SSH login user (typically root)
|
||||
# HOMELAB_SSH_KEY — private key whose public half is in authorized_keys
|
||||
# HOMELAB_SSH_KNOWN_HOSTS — output of: ssh-keyscan -H <HOMELAB_HOST>
|
||||
deploy-homelab:
|
||||
name: Deploy to homelab
|
||||
runs-on: ubuntu-latest
|
||||
needs: [docker]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
printf '%s\n' "${{ secrets.HOMELAB_SSH_KEY }}" > ~/.ssh/homelab_key
|
||||
chmod 600 ~/.ssh/homelab_key
|
||||
printf '%s\n' "${{ secrets.HOMELAB_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Copy docker-compose.yml to homelab
|
||||
run: |
|
||||
scp -i ~/.ssh/homelab_key \
|
||||
homelab/runner/docker-compose.yml \
|
||||
"${{ secrets.HOMELAB_USER }}@${{ secrets.HOMELAB_HOST }}:/opt/libnovel-runner/docker-compose.yml"
|
||||
|
||||
- name: Pull new runner image and restart
|
||||
run: |
|
||||
ssh -i ~/.ssh/homelab_key \
|
||||
"${{ secrets.HOMELAB_USER }}@${{ secrets.HOMELAB_HOST }}" \
|
||||
'set -euo pipefail
|
||||
cd /opt/libnovel-runner
|
||||
doppler run --project libnovel --config prd_homelab -- docker compose pull runner
|
||||
doppler run --project libnovel --config prd_homelab -- docker compose up -d runner'
|
||||
|
||||
# ── Gitea release ─────────────────────────────────────────────────────────────
|
||||
release:
|
||||
name: Gitea Release
|
||||
|
||||
60
HOMELAB_SECRETS_SETUP.md
Normal file
60
HOMELAB_SECRETS_SETUP.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# Homelab Deployment Secrets Setup
|
||||
|
||||
The release workflow now includes automatic deployment to the homelab runner server. You need to add these secrets to Gitea.
|
||||
|
||||
## Required Secrets
|
||||
|
||||
Go to: `https://gitea.kalekber.cc/kamil/libnovel/settings/secrets/actions`
|
||||
|
||||
### 1. HOMELAB_HOST
|
||||
```
|
||||
192.168.0.109
|
||||
```
|
||||
|
||||
### 2. HOMELAB_USER
|
||||
```
|
||||
root
|
||||
```
|
||||
|
||||
### 3. HOMELAB_SSH_KEY
|
||||
|
||||
If you want to use the same SSH key as prod:
|
||||
- Copy the value from `PROD_SSH_KEY` secret
|
||||
|
||||
If you want a separate key:
|
||||
```bash
|
||||
# On your local machine or CI runner
|
||||
cat ~/.ssh/id_rsa # or your preferred key
|
||||
```
|
||||
|
||||
### 4. HOMELAB_SSH_KNOWN_HOSTS
|
||||
|
||||
Run this when the homelab server is reachable:
|
||||
```bash
|
||||
ssh-keyscan -H 192.168.0.109 2>/dev/null
|
||||
```
|
||||
|
||||
Expected output format:
|
||||
```
|
||||
|1|base64hash...|192.168.0.109 ssh-rsa AAAAB3NzaC...
|
||||
|1|base64hash...|192.168.0.109 ecdsa-sha2-nistp256 AAAAE2...
|
||||
|1|base64hash...|192.168.0.109 ssh-ed25519 AAAAC3...
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
After adding the secrets, the next release (e.g., v4.1.10) will automatically:
|
||||
1. Build all Docker images
|
||||
2. Deploy to prod (165.22.70.138) ✅
|
||||
3. Deploy to homelab (192.168.0.109) ✅ NEW
|
||||
4. Create a Gitea release
|
||||
|
||||
Both deployments run in parallel for faster releases.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If the homelab deployment fails:
|
||||
- Check that the secrets are set correctly
|
||||
- Verify SSH access: `ssh root@192.168.0.109`
|
||||
- Check Doppler config exists: `doppler configs --project libnovel`
|
||||
- Manually test: `cd /opt/libnovel-runner && doppler run --project libnovel --config prd_homelab -- docker compose pull runner`
|
||||
@@ -843,35 +843,6 @@
|
||||
<p class="text-sm text-(--color-muted) leading-relaxed">{cleanSummary(book.summary)}</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Action buttons (duplicated for desktop convenience) -->
|
||||
<div class="mt-auto flex flex-col gap-2.5 pt-4 border-t border-(--color-border)">
|
||||
<button type="button" onclick={() => doAction('read_now')} disabled={animating}
|
||||
class="w-full flex items-center justify-center gap-2 py-3 rounded-xl bg-blue-500 text-white font-bold text-sm hover:bg-blue-400 active:scale-95 transition-all disabled:opacity-40 shadow-lg shadow-blue-500/20">
|
||||
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>
|
||||
Read Now
|
||||
</button>
|
||||
<div class="flex gap-2">
|
||||
<button type="button" onclick={() => doAction('skip')} disabled={animating}
|
||||
class="flex-1 flex items-center justify-center gap-1.5 py-2.5 rounded-xl bg-red-500/15 border border-red-500/30 text-red-400 text-sm font-semibold hover:bg-red-500/25 active:scale-95 transition-all disabled:opacity-40">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M6 18L18 6M6 6l12 12"/>
|
||||
</svg>
|
||||
Skip
|
||||
</button>
|
||||
<button type="button" onclick={() => doAction('like')} disabled={animating}
|
||||
class="flex-1 flex items-center justify-center gap-1.5 py-2.5 rounded-xl bg-green-500/15 border border-green-500/30 text-green-400 text-sm font-semibold hover:bg-green-500/25 active:scale-95 transition-all disabled:opacity-40">
|
||||
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
|
||||
</svg>
|
||||
Like
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" onclick={() => { showPreview = true; }}
|
||||
class="w-full py-2 rounded-xl text-xs text-(--color-muted) hover:text-(--color-text) hover:bg-(--color-surface-3) transition-colors">
|
||||
More details
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{:else if deckEmpty}
|
||||
<div class="flex-1 flex flex-col items-center justify-center gap-4 text-center p-8 text-(--color-muted)">
|
||||
|
||||
Reference in New Issue
Block a user