add ci checker from need build and deploy
This commit is contained in:
@@ -10,7 +10,21 @@ env: # Переменные окружения
|
|||||||
PLATFORMS: linux/amd64,linux/arm64
|
PLATFORMS: linux/amd64,linux/arm64
|
||||||
|
|
||||||
jobs: # Список выполняемых джоб
|
jobs: # Список выполняемых джоб
|
||||||
need-deploy: # джоба проверки изменений в файлах
|
need-build: # джоба проверки изменений в файлах. При изменении пулит новые файлы и перезапускает контейнер
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
src_changed: ${{ steps.filter.outputs.src }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
src:
|
||||||
|
- 'docs/*'
|
||||||
|
- 'mkdocs.yml'
|
||||||
|
|
||||||
|
need-deploy: # джоба проверки изменений в зависимостях. Если requirements.txt был изменен, то будет выполнена сборка и пуш образа
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
src_changed: ${{ steps.filter.outputs.src }}
|
src_changed: ${{ steps.filter.outputs.src }}
|
||||||
@@ -24,8 +38,8 @@ jobs: # Список выполняемых джоб
|
|||||||
- 'requirements.txt'
|
- 'requirements.txt'
|
||||||
|
|
||||||
build: # джоба сборки и пуша образа. Выполняется если проверка изменений показала что requirements.txt был изменен
|
build: # джоба сборки и пуша образа. Выполняется если проверка изменений показала что requirements.txt был изменен
|
||||||
needs: check-changes
|
needs: need-build
|
||||||
if: needs.check-changes.outputs.src_changed == 'true'
|
if: needs.need-build.outputs.src_changed == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Login to Gitea Registry
|
- name: Login to Gitea Registry
|
||||||
@@ -54,9 +68,11 @@ jobs: # Список выполняемых джоб
|
|||||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: need-deploy
|
||||||
|
if: needs.need-build.outputs.src_changed == 'true'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ theme:
|
|||||||
- navigation.instant
|
- navigation.instant
|
||||||
- navigation.instant.progress
|
- navigation.instant.progress
|
||||||
- navigation.sections
|
- navigation.sections
|
||||||
# - navigation.tabs
|
|
||||||
# - navigation.tabs.sticky
|
|
||||||
- navigation.path
|
- navigation.path
|
||||||
- navigation.top
|
- navigation.top
|
||||||
- navigation.prune
|
- navigation.prune
|
||||||
|
|||||||
Reference in New Issue
Block a user