refactor: Update workflow triggers for E2E tests and deployment processes
All checks were successful
Run Tests / Lint (push) Successful in 36s
Run Tests / Unit Tests (push) Successful in 42s

This commit is contained in:
2025-10-28 13:23:25 +01:00
parent 51aa2fa71d
commit 36da0609ed
3 changed files with 13 additions and 13 deletions

View File

@@ -2,15 +2,13 @@ name: Build and Push Docker Image
on:
workflow_run:
workflows:
- Run Tests
branches:
- main
- Run E2E Tests
types:
- completed
jobs:
build-and-push:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'refs/heads/main')) }}
runs-on: ubuntu-latest
env:
DEFAULT_BRANCH: main
@@ -41,6 +39,10 @@ jobs:
sha="${WORKFLOW_RUN_HEAD_SHA}"
fi
if [[ "$ref_name" == refs/heads/* ]]; then
ref_name="${ref_name#refs/heads/}"
fi
if [ "$ref_name" = "${DEFAULT_BRANCH:-main}" ]; then
echo "on_default=true" >> "$GITHUB_OUTPUT"
else

View File

@@ -3,14 +3,12 @@ on:
workflow_run:
workflows:
- Build and Push Docker Image
branches:
- main
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'refs/heads/main')) }}
runs-on: ubuntu-latest
env:
DEFAULT_BRANCH: main

View File

@@ -1,17 +1,17 @@
name: Run E2E Tests
on:
push:
branches:
- '**'
pull_request:
branches:
- main
workflow_run:
workflows:
- Run Tests
types:
- completed
workflow_dispatch:
jobs:
e2e:
name: E2E Tests
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && (github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'refs/heads/main')) }}
runs-on: ubuntu-latest
container: mcr.microsoft.com/playwright/python:v1.55.0-jammy
env: