Skip to content

Commit

Permalink
Add version file and use it for docker tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwenzel committed Jul 13, 2023
1 parent 0b984b5 commit 60a07ff
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: linkedfactory/linkedfactory-pod

- name: Set version env variable
run: echo "PROJECT_VERSION=$(< server/target/classes/version.txt)" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
tags: linkedfactory/linkedfactory-pod:${{ env.PROJECT_VERSION }}
labels: ${{ steps.meta.outputs.labels }}
10 changes: 10 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,15 @@
</configuration>
</plugin>
</plugins>

<resources>
<resource>
<directory>.</directory>
<filtering>true</filtering>
<includes>
<include>version.txt</include>
</includes>
</resource>
</resources>
</build>
</project>
1 change: 1 addition & 0 deletions server/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${project.version}

0 comments on commit 60a07ff

Please sign in to comment.