feat(cicd): move deploy pipeline to Gitea Actions

- .gitea/workflows/deploy.yaml: test → build ARM64 → push to Gitea
  registry → kubectl set image on push to main
- Remove .github/workflows/deploy.yml (GitHub kept as test-only backup)

Requires Gitea Actions secrets: GITEA_REGISTRY_PASSWORD, KUBECONFIG_B64.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gonçalo Rodrigues 2026-06-26 23:09:34 +01:00
parent 3b294e2e82
commit 2e0163e2b2
2 changed files with 52 additions and 50 deletions

View File

@ -0,0 +1,52 @@
name: deploy
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run tests
run: go test ./...
deploy-finance:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Gitea registry
run: |
echo "${{ secrets.GITEA_REGISTRY_PASSWORD }}" \
| docker login git.gugagr.xyz -u admin --password-stdin
- name: Build and push finance-api
run: |
docker build \
-t git.gugagr.xyz/admin/homelab_finance-api:${{ gitea.sha }} \
-f apps/finance/services/api/Dockerfile \
.
docker push git.gugagr.xyz/admin/homelab_finance-api:${{ gitea.sha }}
- name: Install kubectl
run: |
curl -sSLo kubectl \
https://dl.k8s.io/release/v1.30.0/bin/linux/arm64/kubectl
install -m 0755 kubectl /usr/local/bin/kubectl
- name: Deploy
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG_B64 }}" | base64 -d > ~/.kube/config
kubectl set image deployment/api \
api=git.gugagr.xyz/admin/homelab_finance-api:${{ gitea.sha }} \
-n finance
kubectl rollout status deployment/api -n finance --timeout=120s

View File

@ -1,50 +0,0 @@
name: deploy
on:
push:
branches: [main]
jobs:
deploy-finance:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- 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 Gitea registry
uses: docker/login-action@v3
with:
registry: git.gugagr.xyz
username: admin
password: ${{ secrets.GITEA_REGISTRY_PASSWORD }}
- name: Build and push finance-api
uses: docker/build-push-action@v6
with:
context: .
file: apps/finance/services/api/Dockerfile
platforms: linux/arm64
push: true
tags: git.gugagr.xyz/admin/homelab_finance-api:${{ github.sha }}
cache-from: type=registry,ref=git.gugagr.xyz/admin/homelab_finance-api:buildcache
cache-to: type=registry,ref=git.gugagr.xyz/admin/homelab_finance-api:buildcache,mode=max
- name: Deploy to VPS
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
script: |
kubectl set image deployment/api \
api=git.gugagr.xyz/admin/homelab_finance-api:${{ github.sha }} \
-n finance
kubectl rollout status deployment/api -n finance --timeout=120s