Compare commits
10 Commits
39ce4f9ee9
...
ec9be23afe
Author | SHA1 | Date | |
---|---|---|---|
ec9be23afe | |||
6c4a4b754b | |||
![]() |
270ad0ee50 | ||
![]() |
b4072034f5 | ||
![]() |
93bdddf8ed | ||
![]() |
ddfdd3a92e | ||
![]() |
b1257c57ae | ||
![]() |
afae441d6c | ||
![]() |
0bed4eb617 | ||
![]() |
b494a20b50 |
@ -24,6 +24,11 @@ jobs:
|
|||||||
- name: Build .jar with Maven
|
- name: Build .jar with Maven
|
||||||
run: ./mvnw package spring-boot:repackage
|
run: ./mvnw package spring-boot:repackage
|
||||||
|
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: jar-artifact
|
||||||
|
path: target/*.jar
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
@ -40,24 +45,28 @@ jobs:
|
|||||||
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y
|
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
|
- 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
|
- name: Tag Docker image
|
||||||
run: docker tag walzen665/spring-cicd-test:latest git.walzen665.de/walzen665/spring-cicd-test:latest
|
run: docker tag walzen665/spring-cicd-test:latest git.walzen665.de/walzen665/spring-cicd-test:latest
|
||||||
|
|
||||||
- name: Log in to Gitea Docker Registry
|
- name: Log in to Gitea Docker Registry
|
||||||
run: echo ${{ secrets.GITEAREGISTRYTOKEN }} | docker login -u ${{ secrets.GITEAREGISTRYUSERNAME }} --password-stdin https://git.walzen665.de
|
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
|
- name: Push Docker Image to Gitea
|
||||||
run: docker push git.walzen665.de/walzen665/spring-cicd-test:latest
|
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
|
|
@ -3,8 +3,11 @@
|
|||||||
This is a sample project to demonstrate CI/CD using Gitea and Gitea Runner.
|
This is a sample project to demonstrate CI/CD using Gitea and Gitea Runner.
|
||||||
|
|
||||||
## Details
|
## 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.
|
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.
|
@ -8,6 +8,6 @@ public class DemoRestController {
|
|||||||
|
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public String get() {
|
public String get() {
|
||||||
return "Halloo!";
|
return "Halloooo!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user