docs: enhance README and CI workflow to clarify Docker image build conditions and Gitea Container Registry usage, including new job flags for OpenAPI and code changes
CI / changes (push) Successful in 4s
CI / openapi (push) Has been skipped
CI / go (push) Successful in 20s
CI / bird2 (push) Successful in 15s
CI / docker-images (deploy/docker/bird2/Dockerfile, evobgp-bird2) (push) Successful in 45s
CI / docker-images (deploy/docker/evobgp-agent/Dockerfile, evobgp-agent) (push) Successful in 1m6s
CI / docker-images (deploy/docker/evobgp-web/Dockerfile, evobgp-web) (push) Successful in 51s
CI / docker-images (evobgp-all, 1, deploy/docker/gobinary/Dockerfile, evobgp-all) (push) Successful in 1m27s
CI / docker-images (evobgp-api, 1, deploy/docker/gobinary/Dockerfile, evobgp-api) (push) Successful in 1m32s
CI / docker-images (evobgp-deploy, 0, deploy/docker/gobinary/Dockerfile, evobgp-deploy) (push) Successful in 1m27s
CI / docker-images (evobgp-ingest, 0, deploy/docker/gobinary/Dockerfile, evobgp-ingest) (push) Successful in 1m23s
CI / docker-images (evobgp-node, 0, deploy/docker/gobinary/Dockerfile, evobgp-node) (push) Successful in 1m21s
CI / docker-images (evobgp-render, 0, deploy/docker/gobinary/Dockerfile, evobgp-render) (push) Successful in 1m31s
CI / docker-images (evobgp-scheduler, 0, deploy/docker/gobinary/Dockerfile, evobgp-scheduler) (push) Successful in 1m24s

This commit is contained in:
Denozordec
2026-04-05 18:20:18 +07:00
parent f1b33b9daf
commit c6687b2c91
9 changed files with 134 additions and 27 deletions
+54 -18
View File
@@ -10,43 +10,77 @@ jobs:
changes:
runs-on: ubuntu-latest
outputs:
openapi: ${{ steps.openapi.outputs.changed }}
openapi: ${{ steps.detect.outputs.openapi }}
code: ${{ steps.detect.outputs.code }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: openapi
name: Detect OpenAPI-related file changes
- id: detect
name: Detect changed paths (OpenAPI vs doc-only vs code)
run: |
set -euo pipefail
PATHS="docs/openapi.yaml redocly.yaml"
changed=false
openapi=false
code=true
if [ "${{ github.event_name }}" = "pull_request" ]; then
base="${{ github.event.pull_request.base.sha }}"
head="${{ github.event.pull_request.head.sha }}"
if git diff --name-only "$base" "$head" -- $PATHS | grep -q .; then
changed=true
fi
FILES="$(git diff --name-only "$base" "$head")"
else
before="${{ github.event.before }}"
after="${{ github.sha }}"
if [ -n "$before" ] && [ "$before" != "0000000000000000000000000000000000000000" ]; then
if git diff --name-only "$before" "$after" -- $PATHS | grep -q .; then
changed=true
fi
FILES="$(git diff --name-only "$before" "$after")"
elif git rev-parse --verify HEAD~1 >/dev/null 2>&1; then
if git diff --name-only HEAD~1 HEAD -- $PATHS | grep -q .; then
changed=true
fi
FILES="$(git diff --name-only HEAD~1 HEAD)"
else
# Нет родителя (первый коммит / тонкий clone) — линт OpenAPI выполняем один раз
changed=true
# Нет родителя (первый коммит / тонкий clone) — полный пайплайн + OpenAPI
openapi=true
code=true
echo "openapi=$openapi" >> "$GITHUB_OUTPUT"
echo "code=$code" >> "$GITHUB_OUTPUT"
echo "No parent commit: openapi=true code=true"
exit 0
fi
fi
echo "changed=$changed" >> "$GITHUB_OUTPUT"
echo "OpenAPI lint will run: $changed"
# Пустой diff (редко) — не отключаем сборку из осторожности
if [ -z "$(printf '%s' "$FILES" | tr -d '[:space:]')" ]; then
openapi=false
code=true
echo "openapi=$openapi" >> "$GITHUB_OUTPUT"
echo "code=$code" >> "$GITHUB_OUTPUT"
echo "Empty diff: openapi=false code=true"
exit 0
fi
if printf '%s\n' "$FILES" | grep -qE '^docs/openapi\.yaml$|^redocly\.yaml$'; then
openapi=true
fi
doc_only_all=true
while IFS= read -r f || [ -n "${f:-}" ]; do
[ -z "${f:-}" ] && continue
if [[ "$f" == "README.md" || "$f" == ".gitea/README.md" || "$f" == "web/README.md" || "$f" == "redocly.yaml" || "$f" == docs/* ]]; then
continue
fi
doc_only_all=false
break
done <<< "$FILES"
if $doc_only_all; then
code=false
else
code=true
fi
echo "openapi=$openapi" >> "$GITHUB_OUTPUT"
echo "code=$code" >> "$GITHUB_OUTPUT"
echo "Changed files (first 20):"
printf '%s\n' "$FILES" | head -n 20
echo "openapi=$openapi code=$code"
openapi:
needs: [changes]
@@ -61,6 +95,8 @@ jobs:
run: npx --yes @redocly/cli@1 lint docs/openapi.yaml
go:
needs: [changes]
if: needs.changes.outputs.code == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4