ci: branch deploys

This commit is contained in:
2026-02-10 13:50:57 +01:00
parent 84555d11ed
commit 205880b41a
2 changed files with 22 additions and 11 deletions

View File

@@ -1,9 +1,6 @@
name: CI - Lint, Typecheck & Test
on:
push:
branches-ignore:
- main
pull_request:
jobs:

View File

@@ -3,18 +3,18 @@ name: Build & Deploy KLZ Cables
on:
push:
branches:
- main
- '**'
tags:
- 'v*'
workflow_dispatch:
inputs:
skip_long_checks:
description: 'Skip tests? (true/false)'
required: false
default: 'false'
workflow_dispatch:
inputs:
skip_long_checks:
description: 'Skip tests? (true/false)'
required: false
default: 'false'
concurrency:
group: ${{ github.workflow }}-${{ (github.ref_type == 'tag' && !contains(github.ref_name, '-')) && 'prod' || (github.ref_type == 'tag' && 'staging' || 'testing') }}
group: ${{ github.workflow }}-${{ (github.ref_type == 'tag' && !contains(github.ref_name, '-')) && 'prod' || (github.ref_type == 'tag' && 'staging' || (github.ref_name == 'main' && 'testing' || github.ref_name)) }}
cancel-in-progress: true
jobs:
@@ -113,6 +113,20 @@ jobs:
GOTIFY_TITLE="❓ Unbekannter Tag"
GOTIFY_PRIORITY=3
fi
elif [[ "${{ github.ref_type }}" == "branch" ]]; then
TARGET="branch"
# Slugify branch name: lowercase, replace non-alphanumeric with -, remove leading/trailing -
SLUG=$(echo "$TAG" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//')
IMAGE_TAG="branch-${SLUG}-${SHORT_SHA}"
ENV_FILE=".env.branch-${SLUG}"
TRAEFIK_HOST="${SLUG}.branch.mintel.me"
NEXT_PUBLIC_BASE_URL="https://${SLUG}.branch.mintel.me"
DIRECTUS_URL="https://cms.${SLUG}.branch.mintel.me"
DIRECTUS_HOST="cms.${SLUG}.branch.mintel.me"
PROJECT_NAME="klz-cables-br-${SLUG}"
IS_PROD="false"
GOTIFY_TITLE="🌿 Branch-Deploy ($TAG)"
GOTIFY_PRIORITY=4
else
TARGET="skip"
fi