fix: update CI workflow to use Kaniko with gitea-runner

This commit is contained in:
fchinembiri 2026-05-04 23:05:17 +02:00
parent ccc3d249be
commit c04e597228
1 changed files with 51 additions and 36 deletions

View File

@ -11,61 +11,76 @@ on:
jobs:
build-worker:
runs-on: ubuntu-latest
container: ubuntu-latest
runs-on: gitea-runner
container:
image: gcr.io/kaniko-project/executor:latest
options: --user root
steps:
- name: Checkout repository
run: |
apt-get update && apt-get install -y git
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
cd /workspace
uses: actions/checkout@v4
with:
repository: fchinembiri/geocrop-platform
url: https://git.techarvest.co.zw/fchinembiri/geocrop-platform..git
token: ${{ secrets.GITEA_TOKEN }}
- name: Build Worker with Kaniko
- name: Build and Push Worker
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
cat > /kaniko_executor << 'EOF'
#!/bin/sh
set -e
/kaniko/executor \
--dockerfile /workspace/apps/worker/Dockerfile \
--context /workspace \
--dockerfile apps/worker/Dockerfile \
--context . \
--destination frankchine/geocrop-worker:latest \
--cache=true
EOF
chmod +x /kaniko_executor
/kaniko_executor
--cache=true \
--registry-repository docker.io
build-api:
runs-on: ubuntu-latest
container: ubuntu-latest
runs-on: gitea-runner
container:
image: gcr.io/kaniko-project/executor:latest
options: --user root
steps:
- name: Checkout repository
run: |
apt-get update && apt-get install -y git
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
cd /workspace
uses: actions/checkout@v4
with:
repository: fchinembiri/geocrop-platform
url: https://git.techarvest.co.zw/fchinembiri/geocrop-platform..git
token: ${{ secrets.GITEA_TOKEN }}
- name: Build API with Kaniko
- name: Build and Push API
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
/kaniko/executor \
--dockerfile /workspace/apps/api/Dockerfile \
--context /workspace \
--dockerfile apps/api/Dockerfile \
--context . \
--destination frankchine/geocrop-api:latest \
--cache=true
--cache=true \
--registry-repository docker.io
build-web:
runs-on: ubuntu-latest
container: ubuntu-latest
runs-on: gitea-runner
container:
image: gcr.io/kaniko-project/executor:latest
options: --user root
steps:
- name: Checkout repository
run: |
apt-get update && apt-get install -y git
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
cd /workspace
uses: actions/checkout@v4
with:
repository: fchinembiri/geocrop-platform
url: https://git.techarvest.co.zw/fchinembiri/geocrop-platform..git
token: ${{ secrets.GITEA_TOKEN }}
- name: Build Web with Kaniko
- name: Build and Push Web
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
/kaniko/executor \
--dockerfile /workspace/apps/web/Dockerfile \
--context /workspace \
--dockerfile apps/web/Dockerfile \
--context . \
--destination frankchine/geocrop-web:latest \
--cache=true
--cache=true \
--registry-repository docker.io