Live stream set for 2025-09-20 at 14:00:00 Eastern
Ask questions in the live chat about any programming or lifestyle topic.
This livestream will be on YouTube or you can watch below.
Code hosting with Gitea: CI/CD with Gitea Actions
Are you looking for a lightweight, self-hosted Git service that is easy to set up and comes with built-in CI/CD support? Let me introduce you to Gitea – an open-source alternative to platforms like GitHub and GitLab.
In this post, we will explore what Gitea is, how you can install it using Podman (or Podman Compose), and how to use Gitea Actions for continuous integration. Whether you are a hobbyist, student, or seasoned developer, this guide is designed to help you get started.
What is Gitea?
Gitea is a community-managed lightweight code hosting solution written in Go. It is completely open-source and supports Git repository management, issue tracking, code review, and built-in CI/CD through Gitea Actions.
It is ideal for:
- Small teams or solo developers
- Learning Git in a self-hosted environment
- Testing out CI/CD pipelines without relying on external platforms
Installing Gitea using Podman
Here is how to set up Gitea using Podman and Podman Compose on your local machine or server.
Prerequisites
- Podman and Podman Compose installed
- Root or sudo access
Step-by-Step Installation
Create a podman-compose.yml
file:
version: "3"
services:
gitea:
image: gitea/gitea:latest
container_name: gitea
ports:
- "3000:3000"
- "2222:22"
volumes:
- ./gitea:/data
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
Then run the following command:
podman-compose up -d
Visit http://localhost:3000 in your browser to complete the setup using the web interface.
Using Gitea Actions (CI/CD)
Once your Gitea instance is running, you can set up CI/CD pipelines using Gitea Actions. Although still experimental, it is functional and improving rapidly.
Example: Gitea Action Workflow for Python with requirements.txt
Let us build a simple CI pipeline that runs Python tests every time you push code to your Gitea repository.
1. Create a New Repository
In Gitea, click on New Repository, give it a name like my-python-project
, and initialize it if you like.
2. Add Python Files
At minimum, create two files in your project:
app.py
test_app.py
app.py:
def add(a, b):
return a + b
test_app.py:
from app import add
def test_add():
assert add(2, 3) == 5
3. Create a requirements.txt File
This file tells the CI system what packages to install.
requirements.txt:
pytest
You can create this file manually, or generate it by running:
pip freeze > requirements.txt
In our case, we are just listing pytest
to keep it simple.
4. Add the Gitea Workflow File
Inside your project folder, create the directory .gitea/workflows/
and inside that, create a file named test.yml
.
.gitea/workflows/test.yml:
name: Python CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Run Tests
run: pytest
5. Push Your Code to Gitea
Use the command line to push your files to the Gitea repository:
git init
git remote add origin ssh://gitea@your-gitea-server:2222/your-user/my-python-project.git
git add .
git commit -m 'Initial commit with CI'
git push -u origin main
Replace the remote URL with your actual Gitea instance and repository path.
6. View Workflow Results
In Gitea, click on Actions to view the results. You can check logs, verify steps, and see test output.
Folder Structure Recap
Your project folder should look like this:
my-python-project/
│── app.py
│── test_app.py
│── requirements.txt
└── .gitea/
└── workflows/
└── test.yml
Screenshots and Screencast Tutorial




















Learning Resources
If you are new to Git, CI/CD, or DevOps, here are some resources I offer to help you get started and improve your skills:
- Programming Books by Edward Ojambo
- Online Programming Courses
- One-on-One Programming Tutorials
- Git, Gitea Installation and Repository Migration Services
Final Thoughts
Gitea gives you full control over your Git repositories and offers a clean user interface with useful features for modern development workflows. By combining it with Podman and Gitea Actions, you get a powerful and free self-hosted development platform.
If you have any questions or would like assistance setting up Gitea, feel free to get in touch.
Happy coding!