Skip to content

Commit

Permalink
added python version to reusable build
Browse files Browse the repository at this point in the history
  • Loading branch information
MajoBerger committed Feb 21, 2024
1 parent 69ddfe1 commit 4bcd09e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4bcd09e

Please sign in to comment.