diff --git a/.gitea/workflows/build-push.yaml b/.gitea/workflows/build-push.yaml new file mode 100644 index 0000000..c0e23d5 --- /dev/null +++ b/.gitea/workflows/build-push.yaml @@ -0,0 +1,37 @@ +name: Build and Push Docker Images +on: + push: + branches: + - main + paths: + - 'apps/**' + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: frankchine + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Worker Image + uses: docker/build-push-action@v4 + with: + context: ./apps/worker + push: true + tags: frankchine/geocrop-worker:latest, frankchine/geocrop-worker:${{ github.sha }} + + - name: Build and push API Image + uses: docker/build-push-action@v4 + with: + context: ./apps/api + push: true + tags: frankchine/geocrop-api:latest, frankchine/geocrop-api:${{ github.sha }} diff --git a/k8s/base/gitea-runner.yaml b/k8s/base/gitea-runner.yaml new file mode 100644 index 0000000..fe06e8a --- /dev/null +++ b/k8s/base/gitea-runner.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gitea-runner + namespace: geocrop +spec: + replicas: 1 + selector: + matchLabels: + app: gitea-runner + template: + metadata: + labels: + app: gitea-runner + spec: + containers: + - name: runner + image: gitea/act_runner:latest + env: + - name: GITEA_INSTANCE_URL + value: http://gitea.geocrop.svc.cluster.local:3000 + - name: GITEA_RUNNER_REGISTRATION_TOKEN + value: "3daF7zwBC94Q5YCb1mW1VnfPi4L7pgMxSHhKOBOn" + - name: GITEA_RUNNER_NAME + value: "k3s-runner" + - name: GITEA_RUNNER_LABELS + value: "ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye" + securityContext: + privileged: true # Required for Docker-in-Docker + volumeMounts: + - name: docker-certs + mountPath: /certs + - name: runner-data + mountPath: /data + volumes: + - name: docker-certs + emptyDir: {} + - name: runner-data + emptyDir: {} diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml index ab10c76..c0dcd5f 100644 --- a/k8s/base/kustomization.yaml +++ b/k8s/base/kustomization.yaml @@ -6,6 +6,7 @@ resources: - jupyter.yaml - mlflow.yaml - postgres-postgis.yaml + - gitea-runner.yaml - 10-redis.yaml - 20-minio.yaml - 25-tiler.yaml