This commit is contained in:
samsep101
2026-01-05 14:41:29 +05:00
parent 89f480e44c
commit e79952040e

View File

@@ -1,9 +1,9 @@
name: Build with Kaniko name: Build with Kaniko and Deploy
on: [push] on: [push]
jobs: jobs:
build-and-push: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -12,20 +12,30 @@ jobs:
- name: Build and push with Kaniko - name: Build and push with Kaniko
uses: aevea/action-kaniko@master uses: aevea/action-kaniko@master
with: with:
# Обязательные параметры
registry: harbor.apps.kopikopi.com.ru registry: harbor.apps.kopikopi.com.ru
username: ${{ secrets.HARBOR_USERNAME }} username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }} password: ${{ secrets.HARBOR_PASSWORD }}
image: drone/test # Имя образа без registry image: drone/test
tags: latest,${{ gitea.sha }} tags: latest,${{ gitea.sha }}
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile # Убедитесь, что Dockerfile существует!
build-args: | cache: true
BUILD_DATE=${{ gitea.workflow.created }}
VERSION=${{ gitea.sha }}
# Дополнительные флаги для kaniko - name: Update infrastructure repository
extra-args: | run: |
--snapshot-mode=time # Клонируем team-infra
--use-new-run git clone https://${{ secrets.GITEA_USER }}:${{ secrets.GITEA_TOKEN }}@gitea.apps.kopikopi.com.ru/examples/nginx-intrasture.git
--verbosity=info cd team-infra
# Обновляем тег образа в KubeVela Application
sed -i "s|image:.*drone/test:.*|image: harbor.apps.kopikopi.com.ru/drone/test:${{ gitea.sha }}|g" vela-apps/1-simple/static-site.yaml
# Коммитим и пушим
git config user.name "CI/CD Bot"
git config user.email "ci-cd@kopikopi.com.ru"
git add .
git commit -m "Update static-site to ${{ gitea.sha }}"
git push
env:
GITEA_USER: ${{ secrets.GITEA_USER }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}