Live stream set for 2025-09-23 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.
Getting Started with Gitea Actions for Laravel CI/CD Using Podman and MariaDB
If you are a developer looking for a simple, open-source way to automate testing and deployment of your Laravel applications, Gitea Actions combined with Podman and MariaDB might be just the right solution for you.
In this post, I will walk you through the steps to set up a continuous integration and deployment (CI/CD) workflow for a Laravel app using Gitea Actions that runs tests inside Podman containers connected to a MariaDB database.
What is Gitea and Gitea Actions?
Gitea is a lightweight, self-hosted Git service that is fully open source. It is similar to GitHub but designed to be simple and easy to run on your own server. Gitea Actions is a built-in automation feature that lets you run workflows like tests and deployments triggered by Git events.
Why Use Podman Instead of Docker?
Podman is a container engine compatible with Docker images but runs without a root daemon. This makes it safer and easier to use on Linux distributions like Fedora. Podman can be used with podman-compose
, which is similar to Docker Compose, to manage multi-container applications like Laravel plus MariaDB.
Overview of the Setup
This setup includes the following components:
- Your Laravel application code hosted in Gitea
- A
podman-compose
file defining Laravel app and MariaDB containers - A shell script to start containers, run Laravel tests, and stop containers
- A Gitea Actions workflow that triggers the shell script on every push
Step 1 – Repository Folder Structure
Your Laravel project repository should include the following files and folders for CI/CD:
laravel-app/
├── app/
├── bootstrap/
├── config/
├── database/
├── public/
├── routes/
├── tests/
├── .ci/
│ └── run-tests.sh
├── .gitea/
│ └── workflows/
│ └── ci.yml
├── podman-compose.yml
├── artisan
├── composer.json
└── ...
The key additions are the .ci/run-tests.sh
script, the .gitea/workflows/ci.yml
workflow file, and the podman-compose.yml
file.
Step 2 – Create the Podman Compose File
Create podman-compose.yml
at the root of your repo to define Laravel and MariaDB containers:
version: '3.8'
services:
app:
image: php:8.4-fpm
container_name: laravel-app
working_dir: /var/www/html
volumes:
- ./:/var/www/html
ports:
- "9000:9000"
depends_on:
- db
command: bash -c "composer install && php artisan migrate && php-fpm"
db:
image: mariadb:10.11
container_name: mariadb
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: laravel
MYSQL_USER: laraveluser
MYSQL_PASSWORD: secret
ports:
- "3306:3306"
volumes:
- dbdata:/var/lib/mysql
volumes:
dbdata:
This file will spin up a PHP-FPM container with your Laravel app and a MariaDB database container.
Step 3 – Write the Test Runner Script
Create .ci/run-tests.sh
with the following content:
#!/bin/bash
set -e
echo 'Stopping any existing containers...'
podman-compose -f podman-compose.yml down || true
echo 'Starting containers and running tests...'
podman-compose -f podman-compose.yml up --build -d
# Wait for database to be ready
echo 'Waiting for MariaDB to start...'
sleep 20
echo 'Running Laravel tests...'
podman exec laravel-app php artisan test
TEST_RESULT=$?
echo 'Stopping containers...'
podman-compose -f podman-compose.yml down
exit $TEST_RESULT
Make the script executable:
chmod +x .ci/run-tests.sh
Step 4 – Configure Gitea Actions Workflow
Create .gitea/workflows/ci.yml
to define the workflow triggered on every push to the main
branch:
name: Laravel Podman CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Make test script executable
run: chmod +x .ci/run-tests.sh
- name: Run Laravel tests using Podman
run: .ci/run-tests.sh
This workflow checks out your code, makes your test script executable, and runs it. The test script manages Podman containers and Laravel tests.
Step 5 – Register and Run Gitea Actions Runner
To run Gitea Actions workflows, you need to set up a runner (such as act_runner
) on a Fedora 42 machine where Podman is installed. The runner will pick up workflow jobs and execute your scripts.
Make sure Podman and podman-compose are installed on the runner machine, and your runner user has permissions to run Podman commands.
Summary
With this setup, every push to your Gitea repository triggers the Gitea Actions workflow, which runs your custom shell script. The script spins up Laravel and MariaDB containers inside Podman, runs your Laravel tests, then stops the containers. This creates a secure, open-source CI/CD pipeline without relying on Docker.
Screenshots And Screencast









Learn More and Get Support
I am Edward Ojambo, a software developer passionate about teaching others how to build and automate modern web applications.
- Check out my programming books on Amazon for deeper dives into Laravel, PHP, and more.
- Explore my online programming courses and level up your skills at your own pace.
- Interested in personalized guidance? Reach out for one-on-one programming tutorials.
- Need help installing Laravel, setting up Gitea, Git, or migrating your repositories? Contact me at Ojambo Services and let us get your projects moving.
Conclusion
Using Gitea Actions with Podman and MariaDB is a powerful, open-source way to manage continuous integration and deployment for your Laravel projects. It is flexible, secure, and designed to fit well into a Fedora or Podman-based environment.
If you are ready to take your Laravel app automation to the next level, this setup is a fantastic starting point.
If you want help generating full configuration files or scripts, just let me know.
Disclosure: Some of the links above are referral (affiliate) links. I may earn a commission if you purchase through them - at no extra cost to you.