ci: branch deploys
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
name: CI - Lint, Typecheck & Test
|
name: CI - Lint, Typecheck & Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- main
|
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -3,18 +3,18 @@ name: Build & Deploy KLZ Cables
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- '**'
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
skip_long_checks:
|
skip_long_checks:
|
||||||
description: 'Skip tests? (true/false)'
|
description: 'Skip tests? (true/false)'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
|
||||||
concurrency:
|
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
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -113,6 +113,20 @@ jobs:
|
|||||||
GOTIFY_TITLE="❓ Unbekannter Tag"
|
GOTIFY_TITLE="❓ Unbekannter Tag"
|
||||||
GOTIFY_PRIORITY=3
|
GOTIFY_PRIORITY=3
|
||||||
fi
|
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
|
else
|
||||||
TARGET="skip"
|
TARGET="skip"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user