1 Commits

Author SHA1 Message Date
f49530653b Merge pull request 'initial Release request' (#1) from dev into main
Some checks failed
Build and Deploy Versioned Spring Boot Server / build (push) Failing after 9m45s
Reviewed-on: #1
2025-01-12 01:46:30 -08:00
2 changed files with 11 additions and 39 deletions

View File

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

View File

@@ -1,17 +1,15 @@
version: "3.8" version: "3.8"
services: services:
xpensely-server: xpensely-server:
image: tea.zendric.de/cedric/xpensely-server:0 image: tea.zendric.de/cedric/xpensely-server:latest
labels:
net.unraid.docker.icon: https://tea.zendric.de/Cedric/XpenselyServer/raw/branch/main/src/main/resources/static/xpensely_icon_white.png
container_name: xpensely-server container_name: xpensely-server
ports: ports:
- 3636:8080 - 3636:8080
environment: environment:
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
DB_PORT: 5432 DB_PORT: 5434
DB_P_NAME: xpensely DB_NAME: ${DB_P_NAME}
DB_USERNAME: ${DB_USERNAME} DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD} DB_PASSWORD: ${DB_PASSWORD}
depends_on: depends_on:
@@ -20,14 +18,12 @@ services:
networks: networks:
- xpensely-network - xpensely-network
postgresdb: postgresdb:
labels:
net.unraid.docker.icon: https://raw.githubusercontent.com/docker-library/docs/01c12653951b2fe592c1f93a13b4e289ada0e3a1/postgres/logo.png
image: postgres:14 image: postgres:14
container_name: postgresdb container_name: postgresdb
ports: ports:
- 5432:5432 - 5434:5432
environment: environment:
POSTGRES_DB: xpensely POSTGRES_DB: ${DB_P_NAME}
POSTGRES_USER: ${DB_USERNAME} POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_PASSWORD: ${DB_PASSWORD}
networks: networks:
@@ -36,9 +32,7 @@ services:
- db_data:/var/lib/postgresql/data - db_data:/var/lib/postgresql/data
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"]
- CMD-SHELL
- pg_isready -U ${DB_USERNAME} -d xpensely
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5