From 98de13b41032ae180c70cfea49980912d2851be3 Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Fri, 27 Feb 2026 11:29:40 +0100 Subject: [PATCH] Add Dockerfile and Gitea CI/CD workflows - Dockerfile: eclipse-temurin:25-alpine, exposes port 8080 - build.yml: builds on every branch push with Java 25 - deploy.yml: builds and pushes Docker image on v* tags Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .gitea/workflows/build.yml | 21 +++++++++++++++++++++ .gitea/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ Dockerfile | 5 +++++ 3 files changed, 58 insertions(+) create mode 100644 .gitea/workflows/build.yml create mode 100644 .gitea/workflows/deploy.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..637218d --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,21 @@ +name: Build +on: + push: + branches: + - '*' +jobs: + build: + runs-on: standard-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '25' + cache: 'gradle' + + - name: Build + run: ./gradlew build --no-daemon diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..54f287c --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy +on: + push: + tags: + - 'v*' +jobs: + build: + runs-on: standard-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '25' + cache: 'gradle' + + - name: Build Jar + run: ./gradlew bootJar + + - name: Build Container + run: docker build --tag gitea.seeseepuff.be/seeseemelk/webgit:${{github.ref_name}} . + + - name: Login + with: + package_rw: ${{ secrets.PACKAGE_RW }} + run: docker login gitea.seeseepuff.be -u seeseemelk -p ${{ secrets.PACKAGE_RW }} + + - name: Push Container + run: docker push gitea.seeseepuff.be/seeseemelk/webgit:${{github.ref_name}} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3670456 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:25-alpine +WORKDIR /app +ADD ./build/libs/webgit-0.0.1-SNAPSHOT.jar /app/webgit.jar +ENTRYPOINT ["java", "-jar", "webgit.jar"] +EXPOSE 8080/tcp