- deploy.yml: proper Docker buildx setup, arm64 build, kubectl deploy to staging - promote.yml: production deploy on v* tags with proper image tagging
44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
name: Promote to Production
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
jobs:
|
|
promote:
|
|
name: Promote to Production
|
|
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 Production
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
no-cache: true
|
|
tags: |
|
|
git.cloonar.com/openclawd/snapapi:prod
|
|
git.cloonar.com/openclawd/snapapi:${{ github.ref_name }}
|
|
platforms: linux/arm64
|
|
- name: Deploy to Production
|
|
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/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!"
|