fix: update CI workflow to use Kaniko with gitea-runner
This commit is contained in:
parent
ccc3d249be
commit
c04e597228
|
|
@ -11,61 +11,76 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-worker:
|
build-worker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: gitea-runner
|
||||||
container: ubuntu-latest
|
container:
|
||||||
|
image: gcr.io/kaniko-project/executor:latest
|
||||||
|
options: --user root
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
apt-get update && apt-get install -y git
|
with:
|
||||||
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
|
repository: fchinembiri/geocrop-platform
|
||||||
cd /workspace
|
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: |
|
run: |
|
||||||
cat > /kaniko_executor << 'EOF'
|
|
||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
/kaniko/executor \
|
/kaniko/executor \
|
||||||
--dockerfile /workspace/apps/worker/Dockerfile \
|
--dockerfile apps/worker/Dockerfile \
|
||||||
--context /workspace \
|
--context . \
|
||||||
--destination frankchine/geocrop-worker:latest \
|
--destination frankchine/geocrop-worker:latest \
|
||||||
--cache=true
|
--cache=true \
|
||||||
EOF
|
--registry-repository docker.io
|
||||||
chmod +x /kaniko_executor
|
|
||||||
/kaniko_executor
|
|
||||||
|
|
||||||
build-api:
|
build-api:
|
||||||
runs-on: ubuntu-latest
|
runs-on: gitea-runner
|
||||||
container: ubuntu-latest
|
container:
|
||||||
|
image: gcr.io/kaniko-project/executor:latest
|
||||||
|
options: --user root
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
apt-get update && apt-get install -y git
|
with:
|
||||||
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
|
repository: fchinembiri/geocrop-platform
|
||||||
cd /workspace
|
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: |
|
run: |
|
||||||
/kaniko/executor \
|
/kaniko/executor \
|
||||||
--dockerfile /workspace/apps/api/Dockerfile \
|
--dockerfile apps/api/Dockerfile \
|
||||||
--context /workspace \
|
--context . \
|
||||||
--destination frankchine/geocrop-api:latest \
|
--destination frankchine/geocrop-api:latest \
|
||||||
--cache=true
|
--cache=true \
|
||||||
|
--registry-repository docker.io
|
||||||
|
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: ubuntu-latest
|
runs-on: gitea-runner
|
||||||
container: ubuntu-latest
|
container:
|
||||||
|
image: gcr.io/kaniko-project/executor:latest
|
||||||
|
options: --user root
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
apt-get update && apt-get install -y git
|
with:
|
||||||
git clone http://gitea.geocrop.svc.cluster.local:3000/fchinembiri/geocrop-platform.git /workspace
|
repository: fchinembiri/geocrop-platform
|
||||||
cd /workspace
|
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: |
|
run: |
|
||||||
/kaniko/executor \
|
/kaniko/executor \
|
||||||
--dockerfile /workspace/apps/web/Dockerfile \
|
--dockerfile apps/web/Dockerfile \
|
||||||
--context /workspace \
|
--context . \
|
||||||
--destination frankchine/geocrop-web:latest \
|
--destination frankchine/geocrop-web:latest \
|
||||||
--cache=true
|
--cache=true \
|
||||||
|
--registry-repository docker.io
|
||||||
Loading…
Reference in New Issue