42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
name: Build with Kaniko and Deploy
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push with Kaniko (FIXED TAGS)
|
|
uses: aevea/action-kaniko@master
|
|
with:
|
|
registry: harbor.apps.kopikopi.com.ru
|
|
username: ${{ secrets.HARBOR_USERNAME }}
|
|
password: ${{ secrets.HARBOR_PASSWORD }}
|
|
image: drone/test
|
|
tags: ${{ gitea.sha }} # Добавляем main и latest
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
cache: true
|
|
|
|
- name: Update team-infra repository
|
|
run: |
|
|
# Клонируем ПРАВИЛЬНЫЙ репозиторий team-infra
|
|
git clone https://${{ secrets.USER }}:${{ secrets.GITEA }}@gitea.apps.kopikopi.com.ru/examples/nginx-intrasture.git
|
|
cd nginx-intrasture
|
|
|
|
# Обновляем тег образа на main
|
|
sed -i "s|image:.*drone/test:.*|image: harbor.apps.kopikopi.com.ru/drone/test:main|g" apps/static-site/deployment.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 image to main"
|
|
git push
|
|
env:
|
|
GITEA_USER: ${{ secrets.USER }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA }}
|