CI: robust admin docker build/push on WSL runner.
Use build --load with network=host and retry script like EventHubBack; add deploy concurrency group and 90m timeout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,6 +5,11 @@ on:
|
||||
branches: [master, main]
|
||||
workflow_dispatch:
|
||||
|
||||
# Один runner (WSL): параллельные workflow ломают buildx/act.
|
||||
concurrency:
|
||||
group: eventhub-frontadmin-deploy-ift
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
REGISTRY: git.sabilin.com/eventhub
|
||||
BUILDKIT_PROGRESS: quiet
|
||||
@@ -13,13 +18,13 @@ env:
|
||||
jobs:
|
||||
deploy-ift-admin:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Compute image tag
|
||||
id: meta
|
||||
run: echo "tag=sha-${GITHUB_SHA::12}" >> "$GITHUB_OUTPUT"
|
||||
run: echo "tag=sha-${GITHUB_SHA:0:12}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
@@ -39,16 +44,27 @@ jobs:
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push admin-ui
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/eventhub-admin-ui:${{ steps.meta.outputs.tag }}
|
||||
${{ env.REGISTRY }}/eventhub-admin-ui:ift
|
||||
provenance: false
|
||||
sbom: false
|
||||
- name: Build admin-ui image
|
||||
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: Push admin-ui image
|
||||
run: |
|
||||
set -euo pipefail
|
||||
TAG="${{ steps.meta.outputs.tag }}"
|
||||
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"
|
||||
|
||||
- name: Deploy admin on IFT via SSH
|
||||
uses: appleboy/ssh-action@v0.1.5
|
||||
@@ -59,4 +75,4 @@ jobs:
|
||||
script: |
|
||||
export REGISTRY_USER='${{ secrets.REGISTRY_USER }}'
|
||||
export REGISTRY_PASSWORD='${{ secrets.REGISTRY_PASSWORD }}'
|
||||
/opt/eventhub-ift/devops/scripts/deploy-service.sh ift admin ${{ steps.meta.outputs.tag }}
|
||||
bash /opt/eventhub-ift/devops/scripts/deploy-service.sh ift admin ${{ steps.meta.outputs.tag }}
|
||||
|
||||
Reference in New Issue
Block a user