diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bd0e78a26cf4..382a6749a00f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,6 +25,7 @@ jobs: steps: uses: ./.github/workflows/reusable-docker-build.yml with: + run_python_version_script: 'true' build_id: dspace-dependencies image_name: dspace/dspace-dependencies dockerfile_path: ./Dockerfile.dependencies diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index aa8327f4d11b..22db955aee35 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -8,6 +8,9 @@ on: workflow_call: # Possible Inputs to this reusable job inputs: + run_python_version_script: + required: false + default: false # Build name/id for this Docker build. Used for digest storage to avoid digest overlap between builds. build_id: required: true @@ -55,7 +58,7 @@ env: # For a new commit on other branches, use the branch name as the tag for Docker image. # For a new tag, copy that tag name as the tag for Docker image. IMAGE_TAGS: | - type=raw,value=latest,enable=${{ github.ref_name == github.event.repository.default_branch }} + type=raw,value=dspace-7_x,enable=${{ github.ref_name == github.event.repository.default_branch }} type=ref,event=branch,enable=${{ github.ref_name != github.event.repository.default_branch }} type=ref,event=tag # Define default tag "flavor" for docker/metadata-action per @@ -97,6 +100,10 @@ jobs: - name: Checkout codebase uses: actions/checkout@v4 + - name: Add version + if: ${{ env.run_python_version_script == 'true' }} + run: python scripts/sourceversion.py > dspace/config/VERSION_D.txt + # https://github.com/docker/setup-buildx-action - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3