@@ -45,7 +45,7 @@ concurrency:
4545 cancel-in-progress : true
4646
4747env :
48- WORKFLOW_BRANCH : " main "
48+ WORKFLOW_BRANCH : " mp/docker_branch "
4949 PYTHON_BASE_IMAGE : " python:3.10.18-slim-bullseye"
5050 DATAVISYN_PYTHON_BASE_IMAGE : " 188237246440.dkr.ecr.eu-central-1.amazonaws.com/datavisyn/base/python:main"
5151 NODE_BASE_IMAGE : " node:20.9-bullseye"
@@ -211,26 +211,10 @@ jobs:
211211 id : login-ecr
212212 uses :
aws-actions/[email protected] 213213
214- - name : Extract branch and SHA
215- id : extract-branch
216- run : |
217- # Use HEAD_REF for PRs, fallback to REF_NAME for pushes.
218- BRANCH_NAME_RAW="${HEAD_REF:-$REF_NAME}"
219- # Clean up the ref by removing 'refs/heads/' or 'refs/tags/'
220- BRANCH_NAME="${BRANCH_NAME_RAW#refs/heads/}"
221- BRANCH_NAME="${BRANCH_NAME#refs/tags/}"
222-
223- # A manual input from workflow_dispatch will always override the detected branch name
224- if [ -n "${MANUAL_BRANCH}" ]; then
225- BRANCH_NAME="${MANUAL_BRANCH}"
226- fi
227-
228- echo "branch=${BRANCH_NAME}" >> $GITHUB_OUTPUT
229- echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
230- env :
231- HEAD_REF : ${{ github.head_ref }}
232- REF_NAME : ${{ github.ref_name }}
233- MANUAL_BRANCH : ${{ inputs.branch }}
214+ - uses : ./tmp/github-workflows/.github/actions/get-branch
215+ id : get-branch
216+ with :
217+ branch : ${{ inputs.branch }}
234218
235219 - name : Build image
236220 uses : docker/build-push-action@v6
@@ -244,8 +228,8 @@ jobs:
244228 # Disable the cache to avoid outdated (base) images
245229 no-cache : true
246230 build-args : |
247- GIT_BRANCH=${{ steps.extract -branch.outputs.branch }}
248- GIT_COMMIT=${{ steps.extract -branch.outputs.commit }}
231+ GIT_BRANCH=${{ steps.get -branch.outputs.branch }}
232+ GIT_COMMIT=${{ steps.get -branch.outputs.commit }}
249233 DOCKERFILE_DIRECTORY=${{ matrix.component.flavor_directory }}/${{ matrix.component.directory }}
250234 PYTHON_BASE_IMAGE=${{ env.PYTHON_BASE_IMAGE }}
251235 DATAVISYN_PYTHON_BASE_IMAGE=${{ env.DATAVISYN_PYTHON_BASE_IMAGE }}
0 commit comments