From 2f8a244f1ac607d36cceab8b36dbc4c39f2e2aab Mon Sep 17 00:00:00 2001 From: Damir Mukimov Date: Fri, 26 Dec 2025 12:50:06 +0100 Subject: [PATCH] Refactor CI configuration to use Kaniko directly for building and pushing Docker images - Replace aevea/action-kaniko with direct Kaniko executor commands for frontend and backend builds - Add Docker authentication setup for Kaniko - Update Kaniko image version to v1.24.0 and enhance caching options --- .gitea/workflows/ci.yml | 52 ++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2bb2959..d98bf51 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -40,20 +40,24 @@ jobs: runs-on: ubuntu-latest needs: frontend-lint if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master' + container: + image: gcr.io/kaniko-project/executor:v1.24.0 steps: - uses: actions/checkout@v4 + - name: Set up Docker authentication + run: | + mkdir -p /kaniko/.docker + echo "{\"auths\":{\"registry.bk.glpx.pro\":{\"username\":\"${{ secrets.DOCKER_USERNAME }}\",\"password\":\"${{ secrets.DOCKER_PASSWORD }}\"}}}" > /kaniko/.docker/config.json - name: Build and push frontend with Kaniko - uses: aevea/action-kaniko@v0.9.0 - with: - registry: registry.bk.glpx.pro - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - image: turash/turash-frontend - tag: latest,${{ gitea.sha }} - cache: true - cache_registry: registry.bk.glpx.pro/turash/turash-frontend - context: bugulma/frontend - dockerfile: bugulma/frontend/Dockerfile + run: | + /kaniko/executor \ + --dockerfile=bugulma/frontend/Dockerfile \ + --context=bugulma/frontend \ + --destination=registry.bk.glpx.pro/turash/turash-frontend:latest \ + --destination=registry.bk.glpx.pro/turash/turash-frontend:${{ gitea.sha }} \ + --cache=true \ + --cache-ttl=168h \ + --compressed-caching=false backend-lint: runs-on: ubuntu-latest @@ -102,20 +106,24 @@ jobs: runs-on: ubuntu-latest needs: backend-lint if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master' + container: + image: gcr.io/kaniko-project/executor:v1.24.0 steps: - uses: actions/checkout@v4 + - name: Set up Docker authentication + run: | + mkdir -p /kaniko/.docker + echo "{\"auths\":{\"registry.bk.glpx.pro\":{\"username\":\"${{ secrets.DOCKER_USERNAME }}\",\"password\":\"${{ secrets.DOCKER_PASSWORD }}\"}}}" > /kaniko/.docker/config.json - name: Build and push backend with Kaniko - uses: aevea/action-kaniko@v0.9.0 - with: - registry: registry.bk.glpx.pro - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - image: turash/turash-backend - tag: latest,${{ gitea.sha }} - cache: true - cache_registry: registry.bk.glpx.pro/turash/turash-backend - context: bugulma/backend - dockerfile: bugulma/backend/Dockerfile + run: | + /kaniko/executor \ + --dockerfile=bugulma/backend/Dockerfile \ + --context=bugulma/backend \ + --destination=registry.bk.glpx.pro/turash/turash-backend:latest \ + --destination=registry.bk.glpx.pro/turash/turash-backend:${{ gitea.sha }} \ + --cache=true \ + --cache-ttl=168h \ + --compressed-caching=false e2e-test: runs-on: ubuntu-latest