refactor: streamline Docker build process in CI configuration and documentation
CI / changes (push) Successful in 6s
CI / openapi (push) Has been skipped
CI / go (push) Successful in 22s
CI / docker-web (push) Failing after 14s
CI / docker-bird (push) Failing after 14s
CI / bird2 (push) Successful in 16s
CI / docker-go (push) Failing after 15s

Updated the CI workflow to utilize a script for generating Docker build variable overrides, simplifying the build commands for Go and Web images. Adjusted the README to reflect the new build process and clarify the usage of environment variables, enhancing overall documentation clarity.
This commit is contained in:
Denozordec
2026-05-19 10:51:55 +07:00
parent 27e01d010f
commit 6025f383f1
3 changed files with 59 additions and 30 deletions
+21 -23
View File
@@ -219,18 +219,17 @@ jobs:
password: ${{ secrets.ACTIONS_PAT || gitea.token }}
- name: Build and push Go images (bake)
env:
OWNER_LC: ${{ steps.meta.outputs.owner_lc }}
REGISTRY: git.shts.su/${{ steps.meta.outputs.owner_lc }}
IMAGE_TAG: latest
SHORT_SHA: ${{ steps.meta.outputs.short_sha }}
SHA_FULL: ${{ github.sha }}
CACHE_REF_GO: git.shts.su/${{ steps.meta.outputs.owner_lc }}/evobgp-buildcache:go-buildcache
CACHE_REF_WEB: ""
run: |
set -euxo pipefail
cd "${{ github.workspace }}/deploy/docker"
docker buildx bake -f docker-bake.hcl go-images \
--push \
--var "REGISTRY=git.shts.su/${OWNER_LC}" \
--var "IMAGE_TAG=latest" \
--var "SHORT_SHA=${SHORT_SHA}" \
--var "SHA_FULL=${{ github.sha }}" \
--var "CACHE_REF_GO=git.shts.su/${OWNER_LC}/evobgp-buildcache:go-buildcache"
sh write-bake-override.sh
docker buildx bake -f docker-bake.hcl -f docker-bake.override.hcl go-images --push
# ---------------------------------------------------------------------------
# Docker: Web (evobgp-web, evobgp-web-all) — один npm ci (кэш) + два nginx-тега.
@@ -262,18 +261,17 @@ jobs:
password: ${{ secrets.ACTIONS_PAT || gitea.token }}
- name: Build and push Web images (bake)
env:
OWNER_LC: ${{ steps.meta.outputs.owner_lc }}
REGISTRY: git.shts.su/${{ steps.meta.outputs.owner_lc }}
IMAGE_TAG: latest
SHORT_SHA: ${{ steps.meta.outputs.short_sha }}
SHA_FULL: ${{ github.sha }}
CACHE_REF_GO: ""
CACHE_REF_WEB: git.shts.su/${{ steps.meta.outputs.owner_lc }}/evobgp-buildcache:web-buildcache
run: |
set -euxo pipefail
cd "${{ github.workspace }}/deploy/docker"
docker buildx bake -f docker-bake.hcl web-images \
--push \
--var "REGISTRY=git.shts.su/${OWNER_LC}" \
--var "IMAGE_TAG=latest" \
--var "SHORT_SHA=${SHORT_SHA}" \
--var "SHA_FULL=${{ github.sha }}" \
--var "CACHE_REF_WEB=git.shts.su/${OWNER_LC}/evobgp-buildcache:web-buildcache"
sh write-bake-override.sh
docker buildx bake -f docker-bake.hcl -f docker-bake.override.hcl web-images --push
# ---------------------------------------------------------------------------
# Docker: BIRD2 (evobgp-bird2).
@@ -306,14 +304,14 @@ jobs:
password: ${{ secrets.ACTIONS_PAT || gitea.token }}
- name: Build and push evobgp-bird2 (bake)
env:
OWNER_LC: ${{ steps.meta.outputs.owner_lc }}
REGISTRY: git.shts.su/${{ steps.meta.outputs.owner_lc }}
IMAGE_TAG: latest
SHORT_SHA: ${{ steps.meta.outputs.short_sha }}
SHA_FULL: ${{ github.sha }}
CACHE_REF_GO: ""
CACHE_REF_WEB: ""
run: |
set -euxo pipefail
cd "${{ github.workspace }}/deploy/docker"
docker buildx bake -f docker-bake.hcl evobgp-bird2 \
--push \
--var "REGISTRY=git.shts.su/${OWNER_LC}" \
--var "IMAGE_TAG=latest" \
--var "SHORT_SHA=${SHORT_SHA}" \
--var "SHA_FULL=${{ github.sha }}"
sh write-bake-override.sh
docker buildx bake -f docker-bake.hcl -f docker-bake.override.hcl evobgp-bird2 --push