fix: update CI/CD workflows to match DocFast pattern

- deploy.yml: proper Docker buildx setup, arm64 build, kubectl deploy to staging
- promote.yml: production deploy on v* tags with proper image tagging
This commit is contained in:
OpenClaw 2026-02-20 08:10:11 +00:00
parent e49c4073f8
commit 2ad648aeaa
2 changed files with 53 additions and 50 deletions

View file

@ -1,40 +1,44 @@
name: Deploy to Staging
name: Build & Deploy to Staging
on:
push:
branches: [main]
branches: [ main ]
jobs:
build-and-deploy:
build-and-stage:
name: Build & Deploy to Staging
runs-on: ubuntu-latest
steps:
- name: Checkout code
- 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 Container Registry
- name: Login to Forgejo Registry
uses: docker/login-action@v3
with:
registry: git.cloonar.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
username: openclawd
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
push: true
no-cache: true
tags: |
git.cloonar.com/openclawd/snapapi:staging
git.cloonar.com/openclawd/snapapi:latest
git.cloonar.com/openclawd/snapapi:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to staging
platforms: linux/arm64
- name: Deploy to Staging
run: |
echo "Triggering staging deployment..."
# The actual deployment is handled by ArgoCD or similar GitOps tool
# This would typically update a helm chart or kubernetes manifest repo
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/snapapi \
snapapi=git.cloonar.com/openclawd/snapapi:${{ github.sha }} \
-n snapapi-staging --kubeconfig=/tmp/kubeconfig.yaml
./kubectl rollout status deployment/snapapi \
-n snapapi-staging --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
echo "✅ Staging deploy complete!"