Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Publish Docker Image to GHCR

on:
workflow_dispatch:
push:
branches:
- main
- release
- dev
tags:
- 'v*.*.*' # Semantic versioning pattern
pull_request:
# This triggers on any PR, but we filter by source branch in the job
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -21,6 +22,16 @@ jobs:
steps:
- uses: actions/checkout@v4

# Only continue for PRs if the source branch is dev or release
- name: Check PR source branch
if: github.event_name == 'pull_request'
run: |
echo "PR source branch: ${{ github.head_ref }}"
if [[ "${{ github.head_ref }}" != "dev" && "${{ github.head_ref }}" != "release" ]]; then
echo "Not a PR from dev or release branch. Skipping workflow."
exit 1
fi

- name: Log in to GHCR
uses: docker/login-action@v3
with:
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@

## Github actions

Workflows are centraly hosted in EED_Solutions/eed_gha_workflows.
Workflows are centrally hosted in EED_Solutions/eed_gha_workflows.
Please check for more details here.

### Docker Publish Workflow Triggering

The Docker publish workflow (`publish_docker.yml`) is triggered automatically in the following cases:

- **On any push to the `main` branch.**
- **On any tag pushed to the repository that matches semantic versioning (`v*.*.*`).**
- **When a pull request is opened, synchronized, or reopened and the source branch is named `dev` or `release`.**
- Note: The workflow runs for all PRs, but will immediately exit unless the source branch is `dev` or `release`.

This ensures Docker images are only built and published for main releases, version tags, and changes coming from the main development branches.

## Other

Test EED85-machine
Loading