Compare commits
5 Commits
b669855a56
...
0.1.3
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e0311971d | |||
| 31566d1bd8 | |||
| 3830449377 | |||
| 3db2806a04 | |||
| d26a9bffc5 |
@@ -2,8 +2,8 @@ name: Build and Deploy Versioned Spring Boot Server
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: # Match all tags
|
tags:
|
||||||
- "*"
|
- "*" # Match all tags
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -43,20 +43,42 @@ jobs:
|
|||||||
- name: Extract Tag Version
|
- name: Extract Tag Version
|
||||||
id: extract_version
|
id: extract_version
|
||||||
run: |
|
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
|
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. 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
|
- 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
|
||||||
|
|
||||||
# 9. Push the Docker image with the tag
|
# 11. Push the Docker images with the tags
|
||||||
- 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 }}
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
services:
|
services:
|
||||||
xpensely-server:
|
xpensely-server:
|
||||||
image: tea.zendric.de/cedric/xpensely-server:latest
|
image: tea.zendric.de/cedric/xpensely-server:0
|
||||||
|
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: 5434
|
DB_PORT: 5432
|
||||||
DB_NAME: ${DB_P_NAME}
|
DB_P_NAME: xpensely
|
||||||
DB_USERNAME: ${DB_USERNAME}
|
DB_USERNAME: ${DB_USERNAME}
|
||||||
DB_PASSWORD: ${DB_PASSWORD}
|
DB_PASSWORD: ${DB_PASSWORD}
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -18,12 +20,14 @@ 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:
|
||||||
- 5434:5432
|
- 5432:5432
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: ${DB_P_NAME}
|
POSTGRES_DB: xpensely
|
||||||
POSTGRES_USER: ${DB_USERNAME}
|
POSTGRES_USER: ${DB_USERNAME}
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
networks:
|
networks:
|
||||||
@@ -32,7 +36,9 @@ services:
|
|||||||
- db_data:/var/lib/postgresql/data
|
- db_data:/var/lib/postgresql/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"]
|
test:
|
||||||
|
- CMD-SHELL
|
||||||
|
- pg_isready -U ${DB_USERNAME} -d xpensely
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user