Move docker build/push from deploy-ift to CI (EventHubBack pattern). Deploy no longer needs docker.sock on the WSL runner. Add ensure-docker-daemon.sh for Docker Desktop on host runner.
This commit is contained in:
+47
-1
@@ -6,14 +6,20 @@ on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
# Один runner (DESKTOP-SIR8B3R): параллельные workflow ломают кэш act/actions.
|
||||
concurrency:
|
||||
group: eventhub-frontadmin-ci-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
BUILDKIT_PROGRESS: quiet
|
||||
DOCKER_BUILDKIT: 1
|
||||
REGISTRY: git.sabilin.com/eventhub
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -25,3 +31,43 @@ jobs:
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npm run build
|
||||
|
||||
- name: Wait for Docker daemon
|
||||
if: github.event_name == 'push'
|
||||
run: bash scripts/ensure-docker-daemon.sh 240
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
if: github.event_name == 'push'
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build admin-ui image
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
bash scripts/retry-docker-build.sh 5 60 -- \
|
||||
docker buildx build \
|
||||
--network=host \
|
||||
--file Dockerfile \
|
||||
--tag eventhub-admin-ui:local \
|
||||
--load \
|
||||
--provenance=false \
|
||||
--sbom=false \
|
||||
.
|
||||
|
||||
- name: Login to registry
|
||||
if: github.event_name == 'push'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.sabilin.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Push admin-ui image
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="sha-${GITHUB_SHA:0:12}"
|
||||
docker tag eventhub-admin-ui:local "${REGISTRY}/eventhub-admin-ui:${TAG}"
|
||||
docker tag eventhub-admin-ui:local "${REGISTRY}/eventhub-admin-ui:ift"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub-admin-ui:${TAG}"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub-admin-ui:ift"
|
||||
|
||||
Reference in New Issue
Block a user