11---
22name : " release"
33
4+ env :
5+ DOCKER_IMAGE_NAME : dedicatedcode/reitti
6+
47on :
8+ # Trigger the action manually from the UI
9+ workflow_dispatch :
10+ # Trigger the action when a version tag is pushed
511 push :
612 branches :
713 - " *"
814 tags :
9- - " v* "
15+ - ' [0-9]+.[0-9]+.[0-9]+ ' # Push events to matching numeric semver tags, i.e., 1.0.0, 20.15.10
1016
1117jobs :
1218 tagged-release :
@@ -22,14 +28,27 @@ jobs:
2228 distribution : ' temurin'
2329 cache : maven
2430 - name : Build
25- run : mvn --batch-mode --update-snapshots package -Pdocker
31+ run : mvn --batch-mode --update-snapshots package
2632 - name : Login to Docker Hub
2733 uses : docker/login-action@v2
2834 with :
2935 username : ${{ secrets.DOCKER_HUB_USERNAME }}
3036 password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
31- - name : Build & Publish Latest Docker Image
32- run : mvn spring-boot:build-image -Pdocker -DskipTests -Ddocker.tag=latest
37+
38+ - name : Get the tag name
39+ id : get_version
40+ run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
41+ - name : Build and push Landing Page Docker image
42+ uses : docker/build-push-action@v6
43+ with :
44+ context : .
45+ file : ./Dockerfile
46+ push : true
47+ tags : |
48+ ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
49+ ${{ env.DOCKER_IMAGE_NAME }}:latest
50+ cache-from : type=registry,ref=${{ env.DOCKER_IMAGE_NAME }}:buildcache
51+ cache-to : type=registry,ref=${{ env.DOCKER_IMAGE_NAME }}:buildcache,mode=max
3352 - uses : " marvinpinto/action-automatic-releases@latest"
3453 with :
3554 repo_token : " ${{ secrets.GITHUB_TOKEN }}"
0 commit comments