fix: promote workflow retags staging image instead of rebuilding
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 12m20s
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Failing after 12m20s
Same approach as DocFast — pull :latest (already built by staging CI), retag with version, deploy. No rebuild = same binary that was tested.
This commit is contained in:
parent
3c867c2769
commit
de1215bc32
1 changed files with 19 additions and 19 deletions
|
|
@ -6,39 +6,39 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
promote:
|
promote:
|
||||||
name: Promote to Production
|
name: Deploy to Production
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Install kubectl
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
- name: Set up QEMU
|
curl -sLO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
uses: docker/setup-qemu-action@v3
|
chmod +x kubectl
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to Forgejo Registry
|
- name: Login to Forgejo Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.cloonar.com
|
registry: git.cloonar.com
|
||||||
username: openclawd
|
username: openclawd
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
- name: Build and Push Production
|
|
||||||
uses: docker/build-push-action@v5
|
- name: Retag staging image for production
|
||||||
with:
|
run: |
|
||||||
context: .
|
# Pull the image that staging already built and tested
|
||||||
push: true
|
docker pull --platform linux/arm64 git.cloonar.com/openclawd/snapapi:latest
|
||||||
no-cache: true
|
docker tag git.cloonar.com/openclawd/snapapi:latest \
|
||||||
tags: |
|
|
||||||
git.cloonar.com/openclawd/snapapi:prod
|
|
||||||
git.cloonar.com/openclawd/snapapi:${{ github.ref_name }}
|
git.cloonar.com/openclawd/snapapi:${{ github.ref_name }}
|
||||||
platforms: linux/arm64
|
docker push git.cloonar.com/openclawd/snapapi:${{ github.ref_name }}
|
||||||
|
|
||||||
- name: Deploy to Production
|
- name: Deploy to Production
|
||||||
run: |
|
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
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > /tmp/kubeconfig.yaml
|
||||||
|
|
||||||
./kubectl set image deployment/snapapi \
|
./kubectl set image deployment/snapapi \
|
||||||
snapapi=git.cloonar.com/openclawd/snapapi:${{ github.ref_name }} \
|
snapapi=git.cloonar.com/openclawd/snapapi:${{ github.ref_name }} \
|
||||||
-n snapapi --kubeconfig=/tmp/kubeconfig.yaml
|
-n snapapi --kubeconfig=/tmp/kubeconfig.yaml
|
||||||
|
|
||||||
./kubectl rollout status deployment/snapapi \
|
./kubectl rollout status deployment/snapapi \
|
||||||
-n snapapi --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
|
-n snapapi --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
|
||||||
echo "✅ Production deploy complete!"
|
|
||||||
|
echo "✅ Production deploy complete! Version: ${{ github.ref_name }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue