All checks were successful
Build & Deploy to K3s / Build & Deploy (push) Successful in 7m24s
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
name: Build & Deploy to K3s
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
name: Build & Deploy
|
|
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 K3s
|
|
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 --kubeconfig=/tmp/kubeconfig.yaml
|
|
|
|
./kubectl rollout status deployment/docfast \
|
|
-n docfast --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
|
|
|
|
echo "✅ Deploy complete!"
|