ci: branch deploys
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
name: CI - Lint, Typecheck & Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- main
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -3,7 +3,7 @@ name: Build & Deploy KLZ Cables
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
@@ -14,7 +14,7 @@ on:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user