Merge pull request 'refactor: Update workflow triggers for E2E tests and deployment processes' (#5) from fest/ci-improvement into main
Reviewed-on: #5
This commit is contained in:
@@ -3,14 +3,12 @@ on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Run E2E Tests
|
||||
branches:
|
||||
- main
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,8 +4,6 @@ on:
|
||||
workflow_run:
|
||||
workflows:
|
||||
- Run Tests
|
||||
branches:
|
||||
- main
|
||||
types:
|
||||
- completed
|
||||
workflow_dispatch:
|
||||
@@ -13,7 +11,7 @@ on:
|
||||
jobs:
|
||||
e2e:
|
||||
name: E2E Tests
|
||||
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }}
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user