homelab/.github/workflows/finance-api.yml
Gonçalo Rodrigues 85930ef40f ci: switch to self-hosted runner with local k3d image import
Removes all ghcr.io and registry dependencies. Workflows now build
images locally, import them into k3d, and deploy with kubectl set image
— all on the self-hosted runner which already has Docker and kubectl.

Also removes the github Terraform provider and ci.tf since no registry
pull secrets or GitHub Actions secrets are needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 14:33:12 +01:00

41 lines
906 B
YAML

name: finance-api
on:
push:
branches: [main]
paths:
- apps/finance/**
- go.mod
- go.sum
env:
IMAGE: homelab/finance-api
jobs:
build-and-deploy:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Run tests
run: go test ./apps/finance/services/api/main/...
- name: Build image
run: |
docker build \
-t ${{ env.IMAGE }}:${{ github.sha }} \
-t ${{ env.IMAGE }}:latest \
-f apps/finance/services/api/Dockerfile \
.
- name: Import image into k3d
run: k3d image import ${{ env.IMAGE }}:${{ github.sha }} -c homelab
- name: Deploy
run: |
kubectl set image deployment/api \
api=${{ env.IMAGE }}:${{ github.sha }} \
-n finance
kubectl rollout status deployment/api -n finance --timeout=120s