A CI pipeline is a script that runs on someone else’s machine every time you push, and refuses to let a broken change through. This post builds one on Gitea Actions for a small Spring Boot service: compile, unit tests, integration tests against a real PostgreSQL in a container, an SBOM, and a container image pushed with Jib. Everything the pipeline does was run for real while writing this, and the captured output is quoted below. The one thing that was not run is the workflow file on a Gitea runner — the post says exactly where that line falls.
The days you lose to CI are rarely the happy path. They are a Testcontainers test that passes on your laptop and dies on the runner, an SBOM that is generated but never ships, a registry that answers 404 to a perfectly normal docker push. Those get the length here.
Versions tested. Spring Boot 4.2.0 · Temurin JDK 25.0.5.1+2 · Maven 3.9.11 · Jib 3.5.2 · cyclonedx-maven-plugin 2.9.3 (managed by the Spring Boot parent) · PostgreSQL 17 (postgres:17-alpine) · Docker engine 29.9.3 · Gitea server 1.27.3. The latest Gitea Runner release at the time of writing is 6.1.0 (published 27 November 2026); it was not run for this post. Companion code: java-devops-demo / gitea-actions.
CI is a job that a runner picks up, not something Gitea does
Three words carry the whole model. A workflow is a YAML file in your repository that says “when this happens, do that”. A job is one group of steps in it. A runner is a separate program, running on some machine you control, that asks Gitea “any jobs for me?”, runs the steps, and reports the result. Gitea itself only stores the workflow and shows the logs.
The picture’s point is the dashed arrow’s direction: the runner reaches out to Gitea, not the other way round, so a runner can sit behind a firewall. And because the steps run on the runner’s machine, whatever that machine can do is what your pipeline can do. If it has no Docker daemon, no Testcontainers test will ever pass there. That single fact explains most of the surprises later in this post.
Per the Gitea docs, workflows live in .gitea/workflows/ at the repository root and end in .yaml; Actions has been enabled by default on the instance since Gitea 1.21, but each repository still has to switch it on in its settings. The runner is now called Gitea Runner (gitea-runner, docs cover the 5.x series, release 6.1.0 is current) and needs Git 2.34.1 or newer on its PATH, plus node for JavaScript actions.
A trap before we start. Gitea reads workflows only from the root of a repository. In a repository that holds many modules, like the one this post lives in, a workflow placed inside a module directory is not where Gitea looks, so it does nothing. The workflow here sits ingitea-actions/.gitea/workflows/ci.yamlfor that reason: it is a file to copy to your repository root, and itsdefaults.run.working-directorylines go away when you do.
Runner modes: docker:// labels versus host
A runner advertises labels, and a job’s runs-on must match one. The docs list three label types: docker://<image> runs every job in a fresh container from that image, kubernetes://<image> runs it in a pod, and host runs it directly on the runner’s machine as the runner’s user, with no isolation — the docs recommend that only for repositories you trust.
The choice matters for this pipeline in one place: Testcontainers needs to talk to a Docker daemon. In host mode that is the machine’s daemon, exactly as on a laptop. In docker:// mode the job is itself inside a container, so the daemon has to be made reachable from inside it. Everything below was run in the first situation, a plain machine with Docker.
Going deeper
- Gitea docs: Gitea Runner (labels, requirements)
- Gitea docs: Actions compared with GitHub Actions
- Repository: module README
Split the tests by what they need, so a missing Docker only breaks one half
The service is deliberately tiny: a POST /tickets that stores a ticket in PostgreSQL and a GET /tickets that lists them. The interesting part is how the tests are split. Tests that need nothing but the JVM go in classes ending in Test and run in Maven’s surefire plugin. Tests that need a database go in classes ending in IT and run later, in failsafe, after the jar exists.
The unit test is plain JUnit with no Spring and no Docker (PriorityRulesTest.java). The integration test starts a real PostgreSQL with Testcontainers and lets Spring Boot wire it in with @ServiceConnection (TicketApiIT.java):
@Testcontainers
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class TicketApiIT {
@Container
@ServiceConnection
static PostgreSQLContainer postgres = new PostgreSQLContainer("postgres:17-alpine");
@LocalServerPort
int port;
Failsafe is wired in once in the pom.xml, and from then on mvn verify is the only command the pipeline needs:
<!-- *Test = unit tests (surefire, no Docker). *IT = integration tests (failsafe, needs Docker). -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
This is what the pipeline command does, in order (from output/03-build-test.txt):
[INFO] --- clean:3.5.0:clean (default-clean) ---
[INFO] --- cyclonedx:2.9.3:makeAggregateBom (default) ---
[INFO] --- resources:3.5.0:resources (default-resources) ---
[INFO] --- compiler:3.16.0:compile (default-compile) ---
[INFO] --- resources:3.5.0:testResources (default-testResources) ---
[INFO] --- compiler:3.16.0:testCompile (default-testCompile) ---
[INFO] --- surefire:3.6.1:test (default-test) ---
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 -- in <class>
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] --- jar:3.5.1:jar (default-jar) ---
[INFO] --- spring-boot:4.2.0:repackage (repackage) ---
[INFO] Replacing main artifact /tmp/dd/gitea-actions/target/gitea-actions-demo-1.0.0.jar with repackaged archive, adding nested dependencies in BOOT-INF/.
[INFO] --- failsafe:3.6.1:integration-test (default) ---
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0 -- in <class>
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] --- failsafe:3.6.1:verify (default) ---
[INFO] BUILD SUCCESS
Unit tests first, then the jar, then the integration tests. A failure in the unit tests, which finish in a fraction of a second, stops the build before a container is ever started, which is the whole reason for the split.
Now the failure a CI newcomer meets first. Run the same command where the Docker daemon cannot be reached, as it is on a runner that was installed without Docker (same file, output/03-build-test.txt):
=== Same command where Docker is really unreachable (docker.sock masked in a private mount namespace) ===
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0 -- in <class>
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
23:57:14.999 [main] ERROR org.testcontainers.dockerclient.DockerClientProviderStrategy -- Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 <<< FAILURE! -- in <class>
java.lang.IllegalStateException: Could not find a valid Docker environment. Please see logs and check configuration
[ERROR] TicketApiIT.initializationError ? IllegalState Could not find a valid Docker environment. Please see logs and check configuration
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] BUILD FAILURE
The three unit tests still pass. The integration test dies with Could not find a valid Docker environment, and Maven reports BUILD FAILURE. That message is the fingerprint of “the runner has no usable Docker”, and now you know to look at the runner, not at your code.
Setting DOCKER_HOST to nonsense does not reproduce this. A first draft of the demo script only setDOCKER_HOST=unix:///nonexistent.sock, and the build passed: Testcontainers tries that strategy, then falls back to the default/var/run/docker.sock. The script now masks that socket in a private mount namespace instead (see the comment in 03-build-test.sh). Remember this when you debug a runner: an environment variable pointing nowhere is not the same as no Docker.
Testcontainers when the job itself runs in a container (documented, not run)
I only ran the host-style case. With a docker:// runner label the job is inside a container, so the usual fix is to give that container the host’s Docker socket. That is a real security trade: a container that can reach the host daemon can start containers as root on the host. The act_runner issue tracker has a discussion titled “act_runner is HIGHLY insecure due to binding of docker.sock into all containers”; read it before you enable that on a shared runner. I did not test Testcontainers in this mode, so I have no output to show and no recommended settings.
Going deeper
- Testcontainers for Java documentation
- Related on ankurm.com: jOOQ with Spring Boot 4, Flyway and Testcontainers
- TicketRepository.java, the code the integration test exercises
Cache Maven, or every run downloads the internet again
A CI job starts on a clean machine, so Maven has no local repository and downloads every plugin and dependency before it compiles a line. That is slow and it hammers Maven Central. The fix is to save the local repository (~/.m2/repository) between runs and restore it at the start of the next.
The cost, measured: the same mvn verify -DskipITs against an empty local repository and then against the populated one (output/02-cold-vs-warm-cache.txt):
=== mvn verify -DskipITs, local repository = /tmp/m2-cold-demo ===
cold (empty local repository) downloads: 599 seconds: 44
warm (repository restored) downloads: 0 seconds: 11
local repository size after the run: 110M
(seconds depend on the network; the download counts are the point)
599 downloads and 110 MB the first time, none the second. The seconds depend on the network and the machine, so treat them as indicative; the download count is the stable number. In the workflow this is one line, cache: maven on actions/setup-java, which saves and restores the repository keyed on a hash of your pom.xml files.
What is verified and what is not. The download counts above are real. That cache: maven actually saves and restores on a Gitea Runner depends on the runner’s cache server being enabled and reachable; I could not run a runner for this post and the Gitea caching documentation page failed to load when I tried it, so I make no claim about it. After you enable it, look for a “cache hit” line in the setup-java step on the second run, and compare job times.
Going deeper
An SBOM is a parts list for your jar, and it only helps if it ships with it
A software bill of materials (SBOM) lists every library inside your application, with exact versions and hashes, in a standard format. When the next vulnerability is announced you answer “are we affected?” by searching a file instead of guessing. The format used here is CycloneDX.
Spring Boot does most of the work for you. The Boot 4.2.0 parent POM already configures the CycloneDX plugin: once you list cyclonedx-maven-plugin in your build (no version, no configuration), it runs at generate-resources and writes target/classes/META-INF/sbom/application.cdx.json. Because that is on the classpath, it lands inside the jar and the Actuator can serve it.
The declaration in pom.xml is this short:
<!-- SBOM. spring-boot-starter-parent already binds makeAggregateBom to generate-resources and writes
target/classes/META-INF/sbom/application.cdx.json, so it ends up INSIDE the jar and the actuator
can serve it. Declaring the plugin is all that is needed; the version is managed by Spring Boot. -->
<plugin>
<groupId>org.cyclonedx</groupId>
<artifactId>cyclonedx-maven-plugin</artifactId>
</plugin>
<!-- Image without a Dockerfile and without a Docker daemon in the build step. -->
Here is what the build produced and what is in it (output/04-sbom.txt):
=== mvn -DskipTests package (default: Spring Boot parent wiring) ===
[INFO] --- cyclonedx:2.9.3:makeAggregateBom (default) ---
[INFO] CycloneDX: Creating BOM version 1.6 with 59 component(s)
[INFO] CycloneDX: Writing and validating BOM (JSON): target/classes/META-INF/sbom/application.cdx.json
[INFO] --- jar:3.5.1:jar (default-jar) ---
[INFO] --- spring-boot:4.2.0:repackage (repackage) ---
jar contains: META-INF/sbom/application.cdx.json
=== Inside target/classes/META-INF/sbom/application.cdx.json ===
bomFormat : CycloneDX
specVersion : 1.6
subject : com.ankurm.ci:gitea-actions-demo:1.0.0 (application)
components : 59
by scope : {'required': 59}
all have purl : True
all have hash : True
spring-boot : pkg:maven/org.springframework.boot/[email protected]?type=jar
postgresql : pkg:maven/org.postgresql/[email protected]?type=jar
tomcat-embed-core : pkg:maven/org.apache.tomcat.embed/[email protected]?type=jar
jackson-databind : pkg:maven/tools.jackson.core/[email protected]?type=jar
testcontainers : (not in SBOM)
dependency edges: 60
59 components, every one with a package URL and a hash. Notice that testcontainers is not listed: the SBOM describes what ships, not what you test with. The integration test also checks that /actuator/sbom/application returns this document, so the endpoint is covered by the build, not by hope.
Now the mistake worth knowing, because it produces no error. It is tempting to declare the plugin yourself with the phase you think is right. The repository keeps that as a profile (-Plate-sbom in the pom.xml): re-declaring the parent’s execution (same default id) with <phase>package</phase>.
The diagram shows the order of goals in the build log, and the log confirms it (output/04-sbom.txt). With the override the SBOM is generated after spring-boot:repackage, so the jar is already sealed:
=== The mistake: -Plate-sbom (re-declares the execution with phase=package) ===
[INFO] --- jar:3.5.1:jar (default-jar) ---
[INFO] --- spring-boot:4.2.0:repackage (repackage) ---
[INFO] --- cyclonedx:2.9.3:makeAggregateBom (default) ---
jar contains:
(empty above = the SBOM is not in the jar)
The last two lines are the point: jar contains: is empty. The build is green, a file named like an SBOM exists in target/, and the artifact you deploy has none. I made this exact mistake in the first draft of the module; the symptom was a missing line in the log, nothing else.
Publishing the SBOM next to the build
The workflow uploads the file to Gitea’s generic package registry with one curl, using the URL shape from the docs: /api/packages/{owner}/generic/{package}/{version}/{file}. The version includes the run number so every build is unique, because the docs say a file name can be published only once per version. The run against the real instance, including that rule, is further down in the registry section. Per the Gitea docs, the job’s own GITEA_TOKEN cannot publish to the package registry, so the workflow reads a personal access token from a repository secret.
Going deeper
- CycloneDX specification overview
- Related on ankurm.com: scanning an SBOM with Trivy and OSV-Scanner
- 04-sbom.sh
Build the image with Jib, so the runner needs no Docker for it
Jib builds a container image straight from your Maven project and pushes it to a registry, with no Dockerfile and no Docker daemon in the build step. It splits the app into layers (dependencies change rarely, your classes often) so a push after a small change uploads little. The full tour is in the earlier post Jib for Spring Boot: Container Images Without a Dockerfile; this section is only about running it in CI.
To prove the push without touching a real registry, the script starts a throwaway registry:2 container, runs mvn jib:build against it, and reads the image back (output/05-image-local-registry.txt):
=== 1. mvn -DskipTests jib:build, base image pulled from Docker Hub (non-deterministic: depends on the rate limit) ===
[INFO] Built and pushed image as localhost:5000/gitea-actions-demo, localhost:5000/gitea-actions-demo:1.0.0
[INFO] BUILD SUCCESS
=== 2. same, base image read from the runner's local Docker daemon (-Djib.from.image=docker://...) ===
[INFO] Container entrypoint set to [java, -cp, @/app/jib-classpath-file, com.ankurm.ci.Application]
[INFO] Built and pushed image as localhost:5000/gitea-actions-demo, localhost:5000/gitea-actions-demo:1.0.0
[INFO] BUILD SUCCESS
=== Registry catalog and tags ===
{"repositories":["gitea-actions-demo"]}
{"name":"gitea-actions-demo","tags":["latest","1.0.0"]}
And the image it pushed, from the same file, 05-image-local-registry.txt:
=== Layers in the pushed manifest ===
42166579 sha256:517b871c26ea...
389 sha256:96aae9022e0e...
18461849 sha256:5050cb6f0906...
63112449 sha256:dbda3fb9544c...
32 sha256:4f4fb700ef54...
2464 sha256:fa06fe8ddd50...
22267190 sha256:5c4c7fb44e21...
33240 sha256:79d4cb011a48...
3760 sha256:97981627ec22...
824 sha256:11c50fd61d93...
layers: 10
=== Image config (user, ports, entrypoint) ===
user=1000 ports=map[8080/tcp:{}] entrypoint=[java -cp @/app/jib-classpath-file com.ankurm.ci.Application]
Ten layers, from 32 bytes to 63 MB, a non-root user (1000), and the port declared. That spread is what Jib’s layering is for: the layers that hold your own classes are small, so a code-only change re-pushes little.
Base-image pulls can be rate limited. Jib pulls its base image (eclipse-temurin:25-jre) from Docker Hub unless told otherwise, and Docker Hub limits unauthenticated pulls per IP address. A CI runner is exactly the kind of shared address that hits that limit. The earlier Jib module recorded getting an HTTP 429 from it and works around it by reading the base from the local daemon (-Djib.from.image=docker://eclipse-temurin:25-jre, see its lib.sh); step 2 above is that variant. I also saw the 429 once while preparing this module, but it was not reproducible on demand, so the committed output shows both variants succeeding.
Going deeper
- Related on ankurm.com: Jib for Spring Boot: Container Images Without a Dockerfile
- Jib configuration in pom.xml
- 05-image-local-registry.sh
Where to push: Gitea’s own registry, and the sub-path trap
Gitea ships a container registry and a generic package registry, so in theory the pipeline can push the image and the SBOM back to the same server that runs it. The Gitea docs show the standard flow: docker login gitea.example.com, name the image {registry}/{owner}/{image}, docker push.
Here is that flow against the real instance this blog’s code lives on, which serves Gitea under a URL prefix (https://ankurm.com/git.app). This is the script 06-gitea-registries.sh, output in output/06-gitea-registries.txt:
=== 1. Where does the container registry answer? ===
https://ankurm.com/v2/ -> HTTP 404
https://ankurm.com/git.app/v2/ -> HTTP 200
=== 2. docker login and docker push the way every tutorial writes it ===
$ docker login ankurm.com
Error response from daemon: login attempt to https://ankurm.com/v2/ failed with status: 404 Not Found
$ docker push ankurm.com/asmhatre/gitea-actions-probe:1
unknown: unexpected status from POST request to https://ankurm.com/v2/asmhatre/gitea-actions-probe/blobs/uploads/: 404 Not Found
The diagram shows why. A Docker client turns ankurm.com/owner/img into a request to https://ankurm.com/v2/... — always the root of the host. Gitea’s registry does answer, but at /git.app/v2/, where no Docker client looks. Login fails with 404 and so does the push. No pipeline setting fixes this; it is a property of how the server is mounted.
Two ways out, both about the server rather than the workflow: give Gitea its own host name (git.example.com instead of a sub-path), or add a rule in the reverse proxy that forwards /v2/ on the root host to Gitea. I have not tried the proxy rule; treat it as a lead, not a recipe. Or push the image to a registry that is not Gitea at all — the workflow takes the image name from a variable for that reason.
What does work under the sub-path is the generic package registry, because it is a plain HTTP PUT to a full URL (same transcript):
=== 3. The generic package registry works under the sub-path: upload the SBOM ===
$ curl --upload-file target/classes/META-INF/sbom/application.cdx.json https://ankurm.com/git.app/api/packages/asmhatre/generic/gitea-actions-demo-sbom/1.0.0-demo/application.cdx.json
PUT first time -> HTTP 201
PUT second time -> HTTP 409 (a file name can be published once per version)
downloaded back: CycloneDX 1.6 59 components
DELETE version -> HTTP 204
=== 4. Bad file name ===
PUT file with a space in its name -> HTTP 201
DELETE version (cleanup) -> HTTP 204
packages left named gitea-actions-demo-sbom: 0
201 on the first upload, 409 on the second (a file name can be published once per version), the file downloads back as a 59-component CycloneDX 1.6 document, and deleting the version returns 204. The script cleans up after itself; the last line of the output confirms no package was left behind.
The docs and the server disagree on file names. The Gitea docs say package and file names may contain only letters, digits, dots, hyphens, plus and underscore, and that invalid names return 400. This instance (1.27.3) answered 201 to a file name containing a space (application%20x.cdx.json). Either the docs are stricter than the code or this version is more lenient; I did not dig further. Do not rely on spaces working: stay inside the documented character set.
Token and secrets, briefly
The script reads its token from an environment variable and never writes it to a file; the committed output is passed through a filter that replaces it with *** in case it ever appeared. In the workflow, secret names may use letters, digits and underscores, must not start with a digit, and must not start with GITHUB_ or GITEA_ (Gitea docs). Secrets can be defined for a user, an organisation or a repository; the lowest level wins when names clash. Always pass a secret through env: and use the variable in the shell command, as the workflow does, rather than pasting ${{ secrets.X }} into the command text, where the value is substituted into the script itself. The lint script checks this.
Going deeper
The workflow file, and exactly what was and was not proven
Here is the pipeline in full (.gitea/workflows/ci.yaml). The build job is the one that runs on every push and pull request; the image job runs only when you push a tag starting with v.
name: ci
on:
push:
branches: [main]
tags: ['v*']
pull_request:
concurrency:
group: ci-${{ gitea.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: gitea-actions
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: maven # caches ~/.m2/repository, keyed on pom.xml
# Unit tests (surefire), jar, SBOM, then integration tests (failsafe + Testcontainers).
- name: Build, test, SBOM
run: mvn -B -ntp verify
# GITEA_TOKEN cannot publish packages, so a personal access token with
# write:package lives in a repository secret named PACKAGES_TOKEN.
- name: Publish SBOM to the generic package registry
if: gitea.event_name == 'push'
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
run: |
VERSION="$(mvn -q -ntp help:evaluate -Dexpression=project.version -DforceStdout)"
curl --fail --user "${{ gitea.repository_owner }}:${PACKAGES_TOKEN}" \
--upload-file target/classes/META-INF/sbom/application.cdx.json \
"${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/gitea-actions-demo-sbom/${VERSION}-${{ gitea.run_number }}/application.cdx.json"
image:
needs: build
if: gitea.event_name == 'push' && startsWith(gitea.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
cache: maven
# Jib builds and pushes the image straight to the registry: no Docker daemon needed.
# vars.IMAGE_NAME is e.g. registry.example.com/owner/gitea-actions-demo
- name: Build and push image with Jib
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: >
mvn -B -ntp -DskipTests jib:build
-Dimage.name=${{ vars.IMAGE_NAME }}
-Djib.to.auth.username="$REGISTRY_USER"
-Djib.to.auth.password="$REGISTRY_PASSWORD"
Read it top to bottom: concurrency cancels a superseded run on the same branch; setup-java installs Temurin 25 and caches Maven; one mvn verify does build, unit tests, SBOM and integration tests; the SBOM upload and the image push only happen on a push, never on a pull request, because pull requests from forks should not get your secrets.
What “verified” means here. I could not run a Gitea Runner against the live instance while writing this, so the YAML was never executed by Gitea. What was executed is every command inside it: mvn verify, the SBOM upload, the Jib push, in the same order, by the scripts in the repository on a machine with Docker. What a static check proves is smaller still:
The lint script parses the file and checks the secret rules (output/07-workflow-lint.txt):
=== Parse .gitea/workflows/ci.yaml ===
name : ci
triggers : ['push', 'pull_request']
job build : runs-on=ubuntu-latest needs=- steps=4
- actions/checkout@v4
- actions/setup-java@v4
- Build, test, SBOM
- Publish SBOM to the generic package registry
job image : runs-on=ubuntu-latest needs=build steps=3
- actions/checkout@v4
- actions/setup-java@v4
- Build and push image with Jib
=== Secrets are only ever referenced through env:, never inside a run: line ===
ok: no secret interpolated into a shell command
=== Secret names obey Gitea's rules (no GITHUB_/GITEA_ prefix) ===
secrets.PACKAGES_TOKEN
secrets.REGISTRY_PASSWORD
secrets.REGISTRY_USER
So the YAML is well-formed and no secret is interpolated into a shell command. It does not prove that Gitea accepts every key, that actions/checkout@v4 resolves on your instance (per the docs an action name without a host is fetched from github.com unless the instance sets DEFAULT_ACTIONS_URL to self), or that the cache step works. Run it once on a real runner before you trust it, and send me what broke.
Monorepo or single project? Where the file goes
If your repository holds one project, copy ci.yaml to .gitea/workflows/ci.yaml and delete the defaults.run.working-directory block. If it holds several modules, keep the block, put the file at the root, and add a paths: filter under push and pull_request so a change to one module does not run every module’s pipeline.
Going deeper
- Gitea docs: differences from GitHub Actions (action URLs, token permissions, missing features)
- ci.yaml
- 07-workflow-lint.sh
Should you run CI on Gitea at all?
An honest answer. If you already host Gitea for your code, adding a runner is a small step and it keeps source, packages and builds in one place. If you do not, a runner is one more server to patch, secure and watch, and the one thing here that I could not settle by running — the runner itself — is where most of the operational risk sits (a runner that can start Docker is root on its machine). Also, a sub-path install like this one cannot use Gitea’s container registry from Docker at all without server changes. Choose Gitea Actions for the integration, not because the pipeline is hard to write: the pipeline above is ordinary Maven.
Further reading
- Companion code: java-devops-demo / gitea-actions
- Jib for Spring Boot: Container Images Without a Dockerfile
- Dependency Vulnerability Scanning for Java
- jOOQ with Spring Boot 4 and Testcontainers
- Gitea Actions overview
- Gitea generic package registry
- Gitea container registry
- CycloneDX specification
- Testcontainers for Java
No Comments yet!