test workflow

This commit is contained in:
2025-01-10 23:49:34 +01:00
parent 5546b0ba3b
commit 823b1182be

46
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,46 @@
name: Build and Deploy Spring Boot Server
on:
push:
branches:
- dev
jobs:
build:
runs-on: self-hosted
steps:
# 1. Checkout the code
- name: Checkout code
uses: actions/checkout@v2
# 2. Set up Java and Maven
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: "17"
- name: Verify Maven installation
run: |
mvn -version
# 3. Build the Spring Boot application
- name: Build Spring Boot Application
run: |
mvn clean package -DskipTests
# 4. Set up Docker
- name: Set up Docker
run: |
docker --version
docker-compose --version
# 5. Build the Docker image using docker-compose
- name: Build and Package Docker Image
run: |
docker-compose build
# 6. Start the application with dependencies
- name: Start the Docker Compose Application
run: |
docker-compose up -d