96 lines
2.8 KiB
YAML
96 lines
2.8 KiB
YAML
name: Deploy IFT (core)
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: eventhub-back-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
REGISTRY: git.sabilin.com/eventhub
|
|
BUILDKIT_PROGRESS: quiet
|
|
DOCKER_BUILDKIT: 1
|
|
|
|
jobs:
|
|
deploy-ift-core:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 90
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- 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@v3
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: git.sabilin.com
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push eventhub
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/eventhub:${{ steps.meta.outputs.tag }}
|
|
${{ env.REGISTRY }}/eventhub:ift
|
|
provenance: false
|
|
sbom: false
|
|
|
|
- name: Build and push traefik-coraza
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: docker/traefik
|
|
file: docker/traefik/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/traefik-coraza:${{ steps.meta.outputs.tag }}
|
|
${{ env.REGISTRY }}/traefik-coraza:ift
|
|
provenance: false
|
|
sbom: false
|
|
|
|
- name: Build and push fallback
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: docker/fallback
|
|
file: docker/fallback/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/fallback:${{ steps.meta.outputs.tag }}
|
|
${{ env.REGISTRY }}/fallback:ift
|
|
provenance: false
|
|
sbom: false
|
|
|
|
- name: Build and push bot-emulator
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: test/emulate_users/Dockerfile
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/bot-emulator-users:${{ steps.meta.outputs.tag }}
|
|
${{ env.REGISTRY }}/bot-emulator-users:ift
|
|
provenance: false
|
|
sbom: false
|
|
|
|
- name: Deploy core on IFT via SSH
|
|
uses: appleboy/ssh-action@v0.1.5
|
|
with:
|
|
host: ${{ secrets.IFT_SSH_HOST }}
|
|
username: ${{ secrets.IFT_SSH_USER }}
|
|
key: ${{ secrets.IFT_SSH_PRIVATE_KEY }}
|
|
script: |
|
|
export REGISTRY_USER='${{ secrets.REGISTRY_USER }}'
|
|
export REGISTRY_PASSWORD='${{ secrets.REGISTRY_PASSWORD }}'
|
|
/opt/eventhub-ift/devops/scripts/deploy-service.sh ift core ${{ steps.meta.outputs.tag }}
|