CI: build once with sha-* tags, promote to stage without rebuild.
This commit is contained in:
@@ -5,12 +5,19 @@ on:
|
||||
branches: [master, main]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
REGISTRY: git.sabilin.com/eventhub
|
||||
|
||||
jobs:
|
||||
deploy-ift-core:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Compute image tag
|
||||
id: meta
|
||||
run: echo "tag=sha-${GITHUB_SHA::12}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
@@ -27,7 +34,9 @@ jobs:
|
||||
context: .
|
||||
file: docker/Dockerfile
|
||||
push: true
|
||||
tags: git.sabilin.com/eventhub/eventhub:ift
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/eventhub:${{ steps.meta.outputs.tag }}
|
||||
${{ env.REGISTRY }}/eventhub:ift
|
||||
|
||||
- name: Build and push traefik-coraza
|
||||
uses: docker/build-push-action@v4
|
||||
@@ -35,7 +44,9 @@ jobs:
|
||||
context: docker/traefik
|
||||
file: docker/traefik/Dockerfile
|
||||
push: true
|
||||
tags: git.sabilin.com/eventhub/traefik-coraza:ift
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/traefik-coraza:${{ steps.meta.outputs.tag }}
|
||||
${{ env.REGISTRY }}/traefik-coraza:ift
|
||||
|
||||
- name: Build and push fallback
|
||||
uses: docker/build-push-action@v4
|
||||
@@ -43,7 +54,9 @@ jobs:
|
||||
context: docker/fallback
|
||||
file: docker/fallback/Dockerfile
|
||||
push: true
|
||||
tags: git.sabilin.com/eventhub/fallback:ift
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/fallback:${{ steps.meta.outputs.tag }}
|
||||
${{ env.REGISTRY }}/fallback:ift
|
||||
|
||||
- name: Build and push bot-emulator
|
||||
uses: docker/build-push-action@v4
|
||||
@@ -51,7 +64,9 @@ jobs:
|
||||
context: .
|
||||
file: test/emulate_users/Dockerfile
|
||||
push: true
|
||||
tags: git.sabilin.com/eventhub/bot-emulator-users:ift
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/bot-emulator-users:${{ steps.meta.outputs.tag }}
|
||||
${{ env.REGISTRY }}/bot-emulator-users:ift
|
||||
|
||||
- name: Deploy core on IFT via SSH
|
||||
uses: appleboy/ssh-action@v0.1.5
|
||||
@@ -62,4 +77,4 @@ jobs:
|
||||
script: |
|
||||
export REGISTRY_USER='${{ secrets.REGISTRY_USER }}'
|
||||
export REGISTRY_PASSWORD='${{ secrets.REGISTRY_PASSWORD }}'
|
||||
/opt/eventhub-ift/devops/scripts/deploy-service.sh ift core
|
||||
/opt/eventhub-ift/devops/scripts/deploy-service.sh ift core ${{ steps.meta.outputs.tag }}
|
||||
|
||||
Reference in New Issue
Block a user