File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 11name : Publish Docker Image to GHCR
22
33on :
4- workflow_dispatch :
54 push :
65 branches :
76 - main
8- - release
9- - dev
107 tags :
118 - ' v*.*.*' # Semantic versioning pattern
9+ pull_request :
10+ # This triggers on any PR, but we filter by source branch in the job
11+ types : [opened, synchronize, reopened]
12+ workflow_dispatch :
1213
1314permissions :
1415 contents : read
2122 steps :
2223 - uses : actions/checkout@v4
2324
25+ # Only continue for PRs if the source branch is dev or release
26+ - name : Check PR source branch
27+ if : github.event_name == 'pull_request'
28+ run : |
29+ echo "PR source branch: ${{ github.head_ref }}"
30+ if [[ "${{ github.head_ref }}" != "dev" && "${{ github.head_ref }}" != "release" ]]; then
31+ echo "Not a PR from dev or release branch. Skipping workflow."
32+ exit 1
33+ fi
34+
2435 - name : Log in to GHCR
2536 uses : docker/login-action@v3
2637 with :
Original file line number Diff line number Diff line change 77
88## Github actions
99
10- Workflows are centraly hosted in EED_Solutions/eed_gha_workflows.
10+ Workflows are centrally hosted in EED_Solutions/eed_gha_workflows.
1111Please check for more details here.
1212
13+ ### Docker Publish Workflow Triggering
14+
15+ The Docker publish workflow (`publish_docker.yml`) is triggered automatically in the following cases:
16+
17+ - **On any push to the `main` branch.**
18+ - **On any tag pushed to the repository that matches semantic versioning (`v*.*.*`).**
19+ - **When a pull request is opened, synchronized, or reopened and the source branch is named `dev` or `release`.**
20+ - Note: The workflow runs for all PRs, but will immediately exit unless the source branch is `dev` or `release`.
21+
22+ This ensures Docker images are only built and published for main releases, version tags, and changes coming from the main development branches.
23+
1324## Other
1425
1526Test EED85-machine
You can’t perform that action at this time.
0 commit comments