Compare commits

..

10 Commits

Author SHA1 Message Date
ec9be23afe Update src/main/java/com/example/demo/DemoRestController.java
Some checks failed
Spring App CI / build-jar (push) Successful in 38s
Spring App CI / build-image (push) Failing after 12s
2023-12-13 08:18:32 +00:00
6c4a4b754b Update src/main/java/com/example/demo/DemoRestController.java 2023-12-13 07:22:35 +00:00
Max W
270ad0ee50 Update build.yml 2023-12-08 14:21:58 +01:00
Max W
b4072034f5 Update README.md 2023-12-08 14:16:15 +01:00
Max W
93bdddf8ed Update build.yml 2023-12-08 14:08:36 +01:00
Max W
ddfdd3a92e Update build.yml 2023-12-08 14:04:52 +01:00
Max W
b1257c57ae Update build.yml 2023-12-08 12:51:14 +01:00
Max W
afae441d6c Update build.yml 2023-12-08 12:48:52 +01:00
Max W
0bed4eb617 Update build.yml 2023-12-08 12:39:02 +01:00
Max W
b494a20b50 Update build.yml 2023-12-08 12:34:12 +01:00
3 changed files with 28 additions and 16 deletions

View File

@ -24,6 +24,11 @@ jobs:
- name: Build .jar with Maven
run: ./mvnw package spring-boot:repackage
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: jar-artifact
path: target/*.jar
build-image:
runs-on: ubuntu-22.04
steps:
@ -40,24 +45,28 @@ jobs:
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y
- name: Checkout
uses: actions/checkout@v4
- name: Download .jar Artifact
uses: actions/download-artifact@v3
with:
name: jar-artifact
- name: (Optional) List files and path in the repository
run: |
ls -la
pwd
- name: Build Docker image
run: docker build -t walzen665/spring-cicd-test:latest --build-arg="JAR_FILE=target/demo-0.0.1-SNAPSHOT-spring-boot.jar" .
run: docker build -t walzen665/spring-cicd-test:latest --build-arg="JAR_FILE=demo-0.0.1-SNAPSHOT-spring-boot.jar" .
- name: Tag Docker image
run: docker tag walzen665/spring-cicd-test:latest git.walzen665.de/walzen665/spring-cicd-test:latest
- name: Log in to Gitea Docker Registry
run: echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{ secrets.GITEAREGISTRYUSERNAME }} --password-stdin https://git.walzen665.de
push-image:
runs-on: ubuntu-22.04
steps:
- name: Push Docker Image to Gitea
run: docker push git.walzen665.de/walzen665/spring-cicd-test:latest
collect-artifacts:
runs-on: ubuntu-22.04
steps:
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: artifacts
path: target/*.jar
run: docker push git.walzen665.de/walzen665/spring-cicd-test:latest

View File

@ -3,8 +3,11 @@
This is a sample project to demonstrate CI/CD using Gitea and Gitea Runner.
## Details
Run actions build a executable .jar file with the help of maven. It contains the basic Spring Boot WebApp wich serves a simple HTML page with sample text to `localhost:8080/`.
The configured Action Pipeline builds a executable .jar file with the help of maven. It contains the basic Spring Boot WebApp wich serves a simple HTML page with sample text to `localhost:8080/`.
This project uploads configured artifacts. Checkout `.gitea/workflows` for more details.
The docker compose files used to setup this System can be found in `files` directory.
The docker compose files used to setup this System can be found in `files` directory.
### Docker
Now also creates a sample docker package for remote deployment.

View File

@ -8,6 +8,6 @@ public class DemoRestController {
@GetMapping("/")
public String get() {
return "Halloo!";
return "Halloooo!";
}
}