feat: staging deploy workflow via deploy label#20
Conversation
Add a CI workflow that deploys PRs to staging.remolt.dev when a maintainer adds the `deploy` label. Uses the existing Cloudflare tunnel — just adds/removes an ingress rule at deploy/teardown time. - k8s/staging/ kustomize overlay (reuses base manifests, overrides namespace to remolt-staging + lower resource limits) - .github/workflows/staging.yml with deploy + teardown jobs - Race condition guard: fails if another PR already has the label - Posts staging URL / teardown confirmation as PR comments Prerequisites (one-time manual setup): - GitHub OAuth app for staging.remolt.dev - GitHub environment `staging` with OAuth secrets - Cloudflare DNS CNAME for staging.remolt.dev Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
OAuth secrets (remolt-auth) are stored directly in the cluster, same as production. No GitHub environment or STAGING_* secrets needed — just the existing KUBECONFIG_BASE64 repo secret. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pull_request_target runs the workflow from main, not the PR branch. This prevents a malicious PR from modifying staging.yml to exfiltrate the KUBECONFIG_BASE64 secret. The PR code is still checked out for building the Docker image. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Known gaps for agent web UI proxy (OpenClaw etc.)Before testing OpenClaw end-to-end, these need to be addressed:
|
Summary
staging.remolt.devwhen a maintainer adds thedeploylabelk8s/staging/reuses base manifests with namespace + env overridespull_request_targetto prevent malicious PRs from exfiltrating kubeconfigNew files
.github/workflows/staging.yml— deploy + teardown jobs triggered by label eventsk8s/staging/kustomization.yaml— overlay referencing base manifestsk8s/staging/server-patch.yaml— env var overrides (lower limits, staging namespace/origin).env.staging.example— template for staging OAuth credentialsPrerequisites (one-time manual setup)
staging.remolt.dev(callback:https://staging.remolt.dev/auth/callback)staging.remolt.dev→ existing tunnel UUID.env.stagingfrom.env.staging.example, fill in OAuth credsNo GitHub environment or extra GitHub Actions secrets needed — only the existing repo-level
KUBECONFIG_BASE64.Test plan
deploylabel to a PR → staging workflow runs, comment appears with URLstaging.remolt.dev→ OAuth works, can create sessiondeploylabel → teardown runs, resources cleaned updeploylabel → second fails with error🤖 Generated with Claude Code