SnapAPI/.forgejo/workflows/promote.yml
OpenClaw de1215bc32
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 12m20s
fix: promote workflow retags staging image instead of rebuilding
Same approach as DocFast — pull :latest (already built by staging CI),
retag with version, deploy. No rebuild = same binary that was tested.
2026-02-20 11:34:58 +00:00

44 lines
1.4 KiB
YAML

name: Promote to Production
on:
push:
tags: ['v*']
jobs:
promote:
name: Deploy to Production
runs-on: ubuntu-latest
steps:
- name: Install kubectl
run: |
curl -sLO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
- name: Login to Forgejo Registry
uses: docker/login-action@v3
with:
registry: git.cloonar.com
username: openclawd
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Retag staging image for production
run: |
# Pull the image that staging already built and tested
docker pull --platform linux/arm64 git.cloonar.com/openclawd/snapapi:latest
docker tag git.cloonar.com/openclawd/snapapi:latest \
git.cloonar.com/openclawd/snapapi:${{ github.ref_name }}
docker push git.cloonar.com/openclawd/snapapi:${{ github.ref_name }}
- name: Deploy to Production
run: |
echo "${{ secrets.KUBECONFIG }}" | base64 -d > /tmp/kubeconfig.yaml
./kubectl set image deployment/snapapi \
snapapi=git.cloonar.com/openclawd/snapapi:${{ github.ref_name }} \
-n snapapi --kubeconfig=/tmp/kubeconfig.yaml
./kubectl rollout status deployment/snapapi \
-n snapapi --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
echo "✅ Production deploy complete! Version: ${{ github.ref_name }}"