3 Commits

Author SHA1 Message Date
3830449377 major minor version tagging
All checks were successful
Build and Deploy Spring Boot Server / build (push) Successful in 9m55s
Build and Deploy Versioned Spring Boot Server / build (push) Successful in 9m54s
2025-01-12 12:36:43 +01:00
3db2806a04 fix gitea tag
All checks were successful
Build and Deploy Spring Boot Server / build (push) Successful in 9m53s
Build and Deploy Versioned Spring Boot Server / build (push) Successful in 9m58s
2025-01-12 11:46:29 +01:00
d26a9bffc5 tag
Some checks failed
Build and Deploy Spring Boot Server / build (push) Has been cancelled
Build and Deploy Versioned Spring Boot Server / build (push) Failing after 9m46s
2025-01-12 11:23:17 +01:00
2 changed files with 27 additions and 5 deletions

View File

@@ -2,8 +2,8 @@ name: Build and Deploy Versioned Spring Boot Server
on:
push:
tags: # Match all tags
- "*"
tags:
- "*" # Match all tags
jobs:
build:
@@ -43,20 +43,42 @@ jobs:
- name: Extract Tag Version
id: extract_version
run: |
TAG_VERSION=${GITEA_REF#refs/tags/}
TAG_VERSION=$(echo "${GITHUB_REF}" | sed 's#refs/tags/##')
if [ -z "$TAG_VERSION" ]; then
echo "Error: TAG_VERSION is empty."
exit 1
fi
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
# Extract major and minor versions
MAJOR_VERSION=$(echo "${TAG_VERSION}" | cut -d. -f1)
MINOR_VERSION=$(echo "${TAG_VERSION}" | cut -d. -f1,2)
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV
# 7. Build the Docker image with the tag
- name: Build and Package Docker Image
run: |
docker build -t tea.zendric.de/cedric/xpensely-server:${{ env.TAG_VERSION }} .
# 8. Docker login
# 8. Tag the image with Major Version (e.g., 0)
- name: Tag with Major Version
run: |
docker tag tea.zendric.de/cedric/xpensely-server:${{ env.TAG_VERSION }} tea.zendric.de/cedric/xpensely-server:${{ env.MAJOR_VERSION }}
# 9. Tag the image with Minor Version (e.g., 0.1)
- name: Tag with Minor Version
run: |
docker tag tea.zendric.de/cedric/xpensely-server:${{ env.TAG_VERSION }} tea.zendric.de/cedric/xpensely-server:${{ env.MINOR_VERSION }}
# 10. Docker login
- name: Login to Docker Registry
run: |
echo "${{ secrets.TEAPASSWORD }}" | docker login tea.zendric.de -u ${{ secrets.TEAUSER }} --password-stdin
# 9. Push the Docker image with the tag
# 11. Push the Docker images with the tags
- name: Push the Docker Image to registry
run: |
docker push tea.zendric.de/cedric/xpensely-server:${{ env.TAG_VERSION }}
docker push tea.zendric.de/cedric/xpensely-server:${{ env.MAJOR_VERSION }}
docker push tea.zendric.de/cedric/xpensely-server:${{ env.MINOR_VERSION }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB