CI: unified admin build (same-origin), sha-* tags and stage promote.

This commit is contained in:
2026-07-09 23:04:53 +03:00
parent 95846bde1e
commit f506ed4f95
4 changed files with 38 additions and 20 deletions
+11 -2
View File
@@ -5,12 +5,19 @@ on:
branches: [master, main]
workflow_dispatch:
env:
REGISTRY: git.sabilin.com/eventhub
jobs:
deploy-ift-admin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Compute image tag
id: meta
run: echo "tag=sha-${GITHUB_SHA::12}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v4
with:
node-version: '20'
@@ -34,7 +41,9 @@ jobs:
with:
context: .
push: true
tags: git.sabilin.com/eventhub/eventhub-admin-ui:ift
tags: |
${{ env.REGISTRY }}/eventhub-admin-ui:${{ steps.meta.outputs.tag }}
${{ env.REGISTRY }}/eventhub-admin-ui:ift
- name: Deploy admin on IFT via SSH
uses: appleboy/ssh-action@v0.1.5
@@ -45,4 +54,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
/opt/eventhub-ift/devops/scripts/deploy-service.sh ift admin ${{ steps.meta.outputs.tag }}
+23 -15
View File
@@ -6,19 +6,20 @@ on:
- 'v*'
workflow_dispatch:
env:
REGISTRY: git.sabilin.com/eventhub
jobs:
deploy-stage-admin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Compute image tags
id: meta
run: |
echo "sha_tag=sha-${GITHUB_SHA::12}" >> "$GITHUB_OUTPUT"
echo "release_tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
@@ -30,13 +31,20 @@ jobs:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push admin-ui
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: git.sabilin.com/eventhub/eventhub-admin-ui:stage
- name: Promote admin-ui image (no rebuild)
run: |
set -euo pipefail
SHA="${{ steps.meta.outputs.sha_tag }}"
REL="${{ steps.meta.outputs.release_tag }}"
if ! docker buildx imagetools inspect "${REGISTRY}/eventhub-admin-ui:${SHA}" >/dev/null 2>&1; then
echo "Образ eventhub-admin-ui:${SHA} не найден."
echo "Сначала прогоните IFT deploy для этого коммита (push в master)."
exit 1
fi
docker buildx imagetools create \
-t "${REGISTRY}/eventhub-admin-ui:${REL}" \
-t "${REGISTRY}/eventhub-admin-ui:stage" \
"${REGISTRY}/eventhub-admin-ui:${SHA}"
# Stage admin stack — когда появится stage/docker-compose.admin.yml
- name: Note
run: echo "Образ :stage опубликован. Admin stack на stage — отдельный шаг."
run: echo "Образ :${{ steps.meta.outputs.release_tag }} опубликован. Admin stack на stage — когда появится stage/docker-compose.admin.yml."