Some checks failed
Build and Deploy Spring Boot Server / build (push) Failing after 4s
46 lines
1019 B
YAML
46 lines
1019 B
YAML
name: Build and Deploy Spring Boot Server
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
# 1. Checkout the code
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
# 2. Set up Java and Maven
|
|
- name: Set up JDK and Maven
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "adoptopenjdk"
|
|
java-version: "17"
|
|
cache: maven
|
|
|
|
# 3. Verify Maven installation
|
|
- name: Install Maven
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y maven
|
|
mvn -version
|
|
|
|
# 4. Build the Spring Boot application
|
|
- name: Build Spring Boot Application
|
|
run: |
|
|
mvn clean package -DskipTests
|
|
|
|
# 5. Set up Docker
|
|
- name: Set up Docker
|
|
run: |
|
|
docker --version
|
|
|
|
# 6. Build the Docker image
|
|
- name: Build and Package Docker Image
|
|
run: |
|
|
docker build -t tea.zendric.de/zendric/XpenselyServer:1.0.0 .
|