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: on:
workflow_run: workflow_run:
workflows: workflows:
- Run Tests - Run E2E Tests
branches:
- main
types: types:
- completed - completed
jobs: jobs:
build-and-push: 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 runs-on: ubuntu-latest
env: env:
DEFAULT_BRANCH: main DEFAULT_BRANCH: main
@@ -41,6 +39,10 @@ jobs:
sha="${WORKFLOW_RUN_HEAD_SHA}" sha="${WORKFLOW_RUN_HEAD_SHA}"
fi fi
if [[ "$ref_name" == refs/heads/* ]]; then
ref_name="${ref_name#refs/heads/}"
fi
if [ "$ref_name" = "${DEFAULT_BRANCH:-main}" ]; then if [ "$ref_name" = "${DEFAULT_BRANCH:-main}" ]; then
echo "on_default=true" >> "$GITHUB_OUTPUT" echo "on_default=true" >> "$GITHUB_OUTPUT"
else else

View File

@@ -3,14 +3,12 @@ on:
workflow_run: workflow_run:
workflows: workflows:
- Build and Push Docker Image - Build and Push Docker Image
branches:
- main
types: types:
- completed - completed
jobs: jobs:
deploy: 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 runs-on: ubuntu-latest
env: env:
DEFAULT_BRANCH: main DEFAULT_BRANCH: main

View File

@@ -1,17 +1,17 @@
name: Run E2E Tests name: Run E2E Tests
on: on:
push: workflow_run:
branches: workflows:
- '**' - Run Tests
pull_request: types:
branches: - completed
- main
workflow_dispatch: workflow_dispatch:
jobs: jobs:
e2e: e2e:
name: E2E Tests 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 runs-on: ubuntu-latest
container: mcr.microsoft.com/playwright/python:v1.55.0-jammy container: mcr.microsoft.com/playwright/python:v1.55.0-jammy
env: env: