Refactor CI configuration to streamline Kaniko usage for Docker builds
Some checks failed
CI/CD Pipeline / backend-lint (push) Failing after 30s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / frontend-lint (push) Successful in 1m37s
CI/CD Pipeline / frontend-build (push) Failing after 25s
CI/CD Pipeline / e2e-test (push) Has been skipped

- Update CI workflow to use Docker run commands for Kaniko instead of containerized execution
- Simplify Docker authentication setup by creating a temporary directory for config
- Ensure proper context and dockerfile paths are used for both frontend and backend builds
This commit is contained in:
Damir Mukimov 2025-12-26 12:56:10 +01:00
parent 2f8a244f1a
commit 3f25e3a786
No known key found for this signature in database
GPG Key ID: 42996CC7C73BC750

View File

@ -40,19 +40,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: frontend-lint needs: frontend-lint
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master' if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master'
container:
image: gcr.io/kaniko-project/executor:v1.24.0
steps: steps:
- uses: actions/checkout@v4 - 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 - name: Build and push frontend with Kaniko
run: | run: |
/kaniko/executor \ mkdir -p /tmp/kaniko-docker
--dockerfile=bugulma/frontend/Dockerfile \ echo "{\"auths\":{\"registry.bk.glpx.pro\":{\"username\":\"${{ secrets.DOCKER_USERNAME }}\",\"password\":\"${{ secrets.DOCKER_PASSWORD }}\"}}}" > /tmp/kaniko-docker/config.json
--context=bugulma/frontend \ docker run --rm \
-v $(pwd):/workspace \
-v /tmp/kaniko-docker:/kaniko/.docker \
-e DOCKER_CONFIG=/kaniko/.docker \
gcr.io/kaniko-project/executor:v1.24.0 \
--dockerfile=/workspace/bugulma/frontend/Dockerfile \
--context=/workspace/bugulma/frontend \
--destination=registry.bk.glpx.pro/turash/turash-frontend:latest \ --destination=registry.bk.glpx.pro/turash/turash-frontend:latest \
--destination=registry.bk.glpx.pro/turash/turash-frontend:${{ gitea.sha }} \ --destination=registry.bk.glpx.pro/turash/turash-frontend:${{ gitea.sha }} \
--cache=true \ --cache=true \
@ -106,19 +106,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: backend-lint needs: backend-lint
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master' if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/master'
container:
image: gcr.io/kaniko-project/executor:v1.24.0
steps: steps:
- uses: actions/checkout@v4 - 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 - name: Build and push backend with Kaniko
run: | run: |
/kaniko/executor \ mkdir -p /tmp/kaniko-docker
--dockerfile=bugulma/backend/Dockerfile \ echo "{\"auths\":{\"registry.bk.glpx.pro\":{\"username\":\"${{ secrets.DOCKER_USERNAME }}\",\"password\":\"${{ secrets.DOCKER_PASSWORD }}\"}}}" > /tmp/kaniko-docker/config.json
--context=bugulma/backend \ docker run --rm \
-v $(pwd):/workspace \
-v /tmp/kaniko-docker:/kaniko/.docker \
-e DOCKER_CONFIG=/kaniko/.docker \
gcr.io/kaniko-project/executor:v1.24.0 \
--dockerfile=/workspace/bugulma/backend/Dockerfile \
--context=/workspace/bugulma/backend \
--destination=registry.bk.glpx.pro/turash/turash-backend:latest \ --destination=registry.bk.glpx.pro/turash/turash-backend:latest \
--destination=registry.bk.glpx.pro/turash/turash-backend:${{ gitea.sha }} \ --destination=registry.bk.glpx.pro/turash/turash-backend:${{ gitea.sha }} \
--cache=true \ --cache=true \