test workflow
This commit is contained in:
46
.gitea/workflows/test.yml
Normal file
46
.gitea/workflows/test.yml
Normal 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
|
||||
Reference in New Issue
Block a user