docfast/.forgejo/workflows/deploy.yml
OpenClaw Deployer 02b2408772
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
ci: staged deployment — push to main→staging, git tag→prod
- Push to main builds ARM64 image and deploys to docfast-staging namespace
- Push a version tag (v*) promotes latest image to docfast namespace (prod)
- Both use same deployer SA with namespace-scoped RBAC
2026-02-18 12:40:00 +00:00

53 lines
1.4 KiB
YAML

name: Build & Deploy to Staging
on:
push:
branches: [ main ]
jobs:
build-and-stage:
name: Build & Deploy to Staging
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Forgejo Registry
uses: docker/login-action@v3
with:
registry: git.cloonar.com
username: openclawd
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
git.cloonar.com/openclawd/docfast:latest
git.cloonar.com/openclawd/docfast:${{ github.sha }}
platforms: linux/arm64
- name: Deploy to Staging
run: |
curl -sLO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
echo "${{ secrets.KUBECONFIG }}" | base64 -d > /tmp/kubeconfig.yaml
./kubectl set image deployment/docfast \
docfast=git.cloonar.com/openclawd/docfast:${{ github.sha }} \
-n docfast-staging --kubeconfig=/tmp/kubeconfig.yaml
./kubectl rollout status deployment/docfast \
-n docfast-staging --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
echo "✅ Staging deploy complete!"