2026-02-12 11:09:41 -08:00
|
|
|
# CV Deploy Workflow
|
|
|
|
|
#
|
|
|
|
|
# Updates the CV deployment to a specific package version, commits
|
|
|
|
|
# the change, and syncs via ArgoCD.
|
|
|
|
|
#
|
|
|
|
|
# Usage:
|
|
|
|
|
# 1. Release a new CV package from the cv repo first
|
|
|
|
|
# 2. Go to Actions > Deploy CV > Run workflow
|
|
|
|
|
# 3. Enter the version to deploy, or leave as "latest"
|
|
|
|
|
|
|
|
|
|
name: Deploy CV
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
inputs:
|
|
|
|
|
version:
|
|
|
|
|
description: 'CV package version to deploy (e.g., v1.0.0, or "latest")'
|
|
|
|
|
required: true
|
|
|
|
|
default: 'latest'
|
|
|
|
|
type: string
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
deploy:
|
|
|
|
|
runs-on: k8s
|
|
|
|
|
steps:
|
|
|
|
|
- name: Resolve version
|
|
|
|
|
id: version
|
|
|
|
|
run: |
|
|
|
|
|
INPUT_VERSION="${{ inputs.version }}"
|
|
|
|
|
|
|
|
|
|
if [ "$INPUT_VERSION" = "latest" ]; then
|
|
|
|
|
echo "Resolving latest CV package version..."
|
Expose Forgejo publicly at forge.eblu.me (#278)
## Summary
Expose Forgejo publicly at `forge.eblu.me` via the Fly.io reverse proxy — the first dynamic, authenticated public-facing service.
- **Forgejo hardening:** Domain changed to forge.eblu.me, SSH stays on forge.ops.eblu.me, reverse proxy trust headers configured, local registration locked to external-only (Authentik SSO)
- **Tailscale Ingress:** ExternalName Service + Ingress in tailscale-operator creates forge.tail8d86e.ts.net endpoint
- **Fly.io proxy:** nginx server block with rate-limited auth endpoints (3r/s), fail2ban with custom nginx-deny action, security headers, /swagger blocked, WebSocket support, 512m body limit
- **Authentik:** OAuth callback updated to forge.eblu.me
- **DNS/TLS:** CNAME record in Pulumi, cert in fly-setup
- **Rename:** ~29 files updated from forge.ops.eblu.me to forge.eblu.me (HTTPS refs only; SSH, container builds, and Caddy table kept as-is)
## Deployment Order
1. `mise run provision-indri -- --tags forgejo` (config changes)
2. Verify forge.ops.eblu.me still works
3. `argocd app set tailscale-operator --revision feature/forge-public && argocd app sync tailscale-operator`
4. Verify `curl https://forge.tail8d86e.ts.net`
5. `cd fly && fly deploy`
6. Verify pre-DNS: `curl -H "Host: forge.eblu.me" https://blumeops-proxy.fly.dev/`
7. `fly certs add forge.eblu.me -a blumeops-proxy`
8. `argocd app set authentik --revision feature/forge-public && argocd app sync authentik`
9. `mise run dns-preview && mise run dns-up`
10. Full verification (see below)
11. Rehearse `mise run fly-shutoff`
12. After merge: reset ArgoCD revisions to main, re-sync
## Verification Checklist
- [ ] forge.eblu.me loads, shows public repos
- [ ] forge.ops.eblu.me still works from tailnet
- [ ] SSH clone via forge.ops.eblu.me:2222 works
- [ ] HTTPS clone via forge.eblu.me works
- [ ] UI shows forge.eblu.me for HTTPS clone, forge.ops.eblu.me for SSH
- [ ] /swagger returns 403
- [ ] Rapid login attempts trigger 429 rate limit
- [ ] fail2ban bans after 5 failed logins in 10 minutes
- [ ] ArgoCD can still sync (SSH unaffected)
- [ ] `mise run fly-shutoff` stops all public traffic
- [ ] `mise run services-check` passes
Reviewed-on: https://forge.eblu.me/eblume/blumeops/pulls/278
2026-03-03 08:40:41 -08:00
|
|
|
VERSION=$(curl -s "https://forge.eblu.me/api/v1/packages/eblume?type=generic&q=cv" \
|
2026-02-12 11:09:41 -08:00
|
|
|
| jq -r '[.[] | select(.name == "cv")] | sort_by(.version) | last | .version // empty')
|
|
|
|
|
|
|
|
|
|
if [ -z "$VERSION" ]; then
|
|
|
|
|
echo "Error: No CV packages found"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo "Resolved latest version: $VERSION"
|
|
|
|
|
else
|
|
|
|
|
VERSION="$INPUT_VERSION"
|
|
|
|
|
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
|
|
|
echo "Error: Version must be in format vX.Y.Z (e.g., v1.0.0)"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Verify the package exists
|
|
|
|
|
TARBALL="cv-${VERSION}.tar.gz"
|
Expose Forgejo publicly at forge.eblu.me (#278)
## Summary
Expose Forgejo publicly at `forge.eblu.me` via the Fly.io reverse proxy — the first dynamic, authenticated public-facing service.
- **Forgejo hardening:** Domain changed to forge.eblu.me, SSH stays on forge.ops.eblu.me, reverse proxy trust headers configured, local registration locked to external-only (Authentik SSO)
- **Tailscale Ingress:** ExternalName Service + Ingress in tailscale-operator creates forge.tail8d86e.ts.net endpoint
- **Fly.io proxy:** nginx server block with rate-limited auth endpoints (3r/s), fail2ban with custom nginx-deny action, security headers, /swagger blocked, WebSocket support, 512m body limit
- **Authentik:** OAuth callback updated to forge.eblu.me
- **DNS/TLS:** CNAME record in Pulumi, cert in fly-setup
- **Rename:** ~29 files updated from forge.ops.eblu.me to forge.eblu.me (HTTPS refs only; SSH, container builds, and Caddy table kept as-is)
## Deployment Order
1. `mise run provision-indri -- --tags forgejo` (config changes)
2. Verify forge.ops.eblu.me still works
3. `argocd app set tailscale-operator --revision feature/forge-public && argocd app sync tailscale-operator`
4. Verify `curl https://forge.tail8d86e.ts.net`
5. `cd fly && fly deploy`
6. Verify pre-DNS: `curl -H "Host: forge.eblu.me" https://blumeops-proxy.fly.dev/`
7. `fly certs add forge.eblu.me -a blumeops-proxy`
8. `argocd app set authentik --revision feature/forge-public && argocd app sync authentik`
9. `mise run dns-preview && mise run dns-up`
10. Full verification (see below)
11. Rehearse `mise run fly-shutoff`
12. After merge: reset ArgoCD revisions to main, re-sync
## Verification Checklist
- [ ] forge.eblu.me loads, shows public repos
- [ ] forge.ops.eblu.me still works from tailnet
- [ ] SSH clone via forge.ops.eblu.me:2222 works
- [ ] HTTPS clone via forge.eblu.me works
- [ ] UI shows forge.eblu.me for HTTPS clone, forge.ops.eblu.me for SSH
- [ ] /swagger returns 403
- [ ] Rapid login attempts trigger 429 rate limit
- [ ] fail2ban bans after 5 failed logins in 10 minutes
- [ ] ArgoCD can still sync (SSH unaffected)
- [ ] `mise run fly-shutoff` stops all public traffic
- [ ] `mise run services-check` passes
Reviewed-on: https://forge.eblu.me/eblume/blumeops/pulls/278
2026-03-03 08:40:41 -08:00
|
|
|
PACKAGE_URL="https://forge.eblu.me/api/packages/eblume/generic/cv/${VERSION}/${TARBALL}"
|
2026-02-12 11:09:41 -08:00
|
|
|
if ! curl -fsSL --head "$PACKAGE_URL" > /dev/null 2>&1; then
|
|
|
|
|
echo "Error: Package not found at $PACKAGE_URL"
|
|
|
|
|
echo "Run the 'Release CV' workflow in the cv repo first."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo "Package verified: $PACKAGE_URL"
|
|
|
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
|
|
|
|
|
|
|
|
- name: Checkout
|
2026-03-24 08:11:46 -07:00
|
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
2026-02-12 11:09:41 -08:00
|
|
|
|
|
|
|
|
- name: Update CV deployment
|
|
|
|
|
run: |
|
|
|
|
|
VERSION="${{ steps.version.outputs.version }}"
|
|
|
|
|
TARBALL="cv-${VERSION}.tar.gz"
|
|
|
|
|
DEPLOYMENT_FILE="argocd/manifests/cv/deployment.yaml"
|
Expose Forgejo publicly at forge.eblu.me (#278)
## Summary
Expose Forgejo publicly at `forge.eblu.me` via the Fly.io reverse proxy — the first dynamic, authenticated public-facing service.
- **Forgejo hardening:** Domain changed to forge.eblu.me, SSH stays on forge.ops.eblu.me, reverse proxy trust headers configured, local registration locked to external-only (Authentik SSO)
- **Tailscale Ingress:** ExternalName Service + Ingress in tailscale-operator creates forge.tail8d86e.ts.net endpoint
- **Fly.io proxy:** nginx server block with rate-limited auth endpoints (3r/s), fail2ban with custom nginx-deny action, security headers, /swagger blocked, WebSocket support, 512m body limit
- **Authentik:** OAuth callback updated to forge.eblu.me
- **DNS/TLS:** CNAME record in Pulumi, cert in fly-setup
- **Rename:** ~29 files updated from forge.ops.eblu.me to forge.eblu.me (HTTPS refs only; SSH, container builds, and Caddy table kept as-is)
## Deployment Order
1. `mise run provision-indri -- --tags forgejo` (config changes)
2. Verify forge.ops.eblu.me still works
3. `argocd app set tailscale-operator --revision feature/forge-public && argocd app sync tailscale-operator`
4. Verify `curl https://forge.tail8d86e.ts.net`
5. `cd fly && fly deploy`
6. Verify pre-DNS: `curl -H "Host: forge.eblu.me" https://blumeops-proxy.fly.dev/`
7. `fly certs add forge.eblu.me -a blumeops-proxy`
8. `argocd app set authentik --revision feature/forge-public && argocd app sync authentik`
9. `mise run dns-preview && mise run dns-up`
10. Full verification (see below)
11. Rehearse `mise run fly-shutoff`
12. After merge: reset ArgoCD revisions to main, re-sync
## Verification Checklist
- [ ] forge.eblu.me loads, shows public repos
- [ ] forge.ops.eblu.me still works from tailnet
- [ ] SSH clone via forge.ops.eblu.me:2222 works
- [ ] HTTPS clone via forge.eblu.me works
- [ ] UI shows forge.eblu.me for HTTPS clone, forge.ops.eblu.me for SSH
- [ ] /swagger returns 403
- [ ] Rapid login attempts trigger 429 rate limit
- [ ] fail2ban bans after 5 failed logins in 10 minutes
- [ ] ArgoCD can still sync (SSH unaffected)
- [ ] `mise run fly-shutoff` stops all public traffic
- [ ] `mise run services-check` passes
Reviewed-on: https://forge.eblu.me/eblume/blumeops/pulls/278
2026-03-03 08:40:41 -08:00
|
|
|
RELEASE_URL="https://forge.eblu.me/api/packages/eblume/generic/cv/${VERSION}/${TARBALL}"
|
2026-02-12 11:09:41 -08:00
|
|
|
|
|
|
|
|
echo "Updating $DEPLOYMENT_FILE with CV_RELEASE_URL..."
|
2026-02-13 10:20:27 -08:00
|
|
|
yq -i "(.spec.template.spec.containers[0].env[] | select(.name == \"CV_RELEASE_URL\")).value = \"${RELEASE_URL}\"" "$DEPLOYMENT_FILE"
|
2026-02-12 11:09:41 -08:00
|
|
|
|
|
|
|
|
echo "Updated deployment:"
|
|
|
|
|
grep -A1 "CV_RELEASE_URL" "$DEPLOYMENT_FILE"
|
|
|
|
|
|
|
|
|
|
- name: Commit release changes
|
|
|
|
|
env:
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
run: |
|
|
|
|
|
VERSION="${{ steps.version.outputs.version }}"
|
|
|
|
|
|
|
|
|
|
git config user.name "Forgejo Actions"
|
|
|
|
|
git config user.email "actions@forge.ops.eblu.me"
|
|
|
|
|
|
|
|
|
|
git add argocd/manifests/cv/deployment.yaml
|
|
|
|
|
|
|
|
|
|
if git diff --cached --quiet; then
|
|
|
|
|
echo "No changes to commit (already at $VERSION)"
|
|
|
|
|
else
|
|
|
|
|
git commit -m "Update CV release to $VERSION
|
|
|
|
|
|
|
|
|
|
[skip ci]"
|
|
|
|
|
git push origin HEAD:main
|
|
|
|
|
echo "Changes committed and pushed"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
- name: Deploy CV
|
|
|
|
|
env:
|
|
|
|
|
ARGOCD_AUTH_TOKEN: ${{ secrets.ARGOCD_AUTH_TOKEN }}
|
|
|
|
|
run: |
|
|
|
|
|
echo "Syncing CV app via ArgoCD..."
|
|
|
|
|
|
|
|
|
|
argocd app sync cv \
|
|
|
|
|
--server argocd.ops.eblu.me \
|
|
|
|
|
--grpc-web \
|
|
|
|
|
--prune
|
|
|
|
|
|
|
|
|
|
argocd app wait cv \
|
|
|
|
|
--server argocd.ops.eblu.me \
|
|
|
|
|
--grpc-web \
|
|
|
|
|
--timeout 120
|
|
|
|
|
|
|
|
|
|
echo "CV app synced successfully!"
|
|
|
|
|
|
2026-02-26 07:53:21 -08:00
|
|
|
- name: Purge Fly.io proxy cache
|
|
|
|
|
env:
|
|
|
|
|
FLY_API_TOKEN: ${{ secrets.FLY_DEPLOY_TOKEN }}
|
|
|
|
|
run: |
|
|
|
|
|
echo "Purging nginx cache on Fly.io proxy..."
|
|
|
|
|
fly ssh console -a blumeops-proxy -C "sh -c 'rm -rf /tmp/cache && nginx -s reload'"
|
|
|
|
|
echo "Cache purged"
|
|
|
|
|
|
2026-02-12 11:09:41 -08:00
|
|
|
- name: Summary
|
|
|
|
|
run: |
|
|
|
|
|
VERSION="${{ steps.version.outputs.version }}"
|
|
|
|
|
echo "================================================"
|
|
|
|
|
echo "CV Deployed: $VERSION"
|
|
|
|
|
echo "================================================"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "CV should now be live at:"
|
|
|
|
|
echo " https://cv.ops.eblu.me/"
|