In our previous blogs, we explored Installing Gitea and Pushing a Fresh Git Repository to the Gitea Server.
Now that we have a working Gitea setup and know how to manage our repositories, it’s time to take the next step — automating deployments.
Manually updating your WordPress site every time you push code can be tedious, time-consuming job
With Gitea Actions Runner (act_runner), we can automate this process so that every push to the repository automatically deploys the changes to your live server.
In this guide, we’ll walk you through setting up a Gitea Runner for Auto Deployment — from installation and configuration to writing the workflow that syncs files directly to your WordPress directory.
Prerequisites
- A working WordPress website hosted on any Linux server.
- Git installed (required for pulling/pushing code)
- Access to the server as root or sudo user
- A non-root user for WordPress file ownership
- Node.js and npm installed (required by act_runner) which can be installed using:
apt install nodejs npm
Step 1: Download and Install Gitea Runner
Gitea provides a self-hosted runner called act_runner (go to https://dl.gitea.com/act_runner/ for download). To install it:
#wget -O act_runner.tar.gz https://dl.gitea.com/act_runner/0.2.12/act_runner-0.2.12-linux-amd64
#tar -xvf act_runner.tar.gz
#mv act_runner /usr/local/bin/
Make sure the binary is executable:
#chmod +x /usr/local/bin/act_runner
Step 2: Generate Registration Token
Log in to your Gitea web interface.
Navigate to your repository → Settings → Actions → Runners.
Click “Generate Registration Token” and it.
Step 3: Create the Configuration File
Create a directory for your runner config:
#mkdir -p /etc/act_runner
#cd /etc/act_runner
#vim /etc/act_runner/config.yaml
Here’s an example configuration:
log:
level: info
runner:
file: .runner
capacity: 1
timeout: 3h
shutdown_timeout: 0s
insecure: false
fetch_timeout: 5s
fetch_interval: 2s
executor: host
labels:
- "host"
host:
workdir_parent: /home/act_runner/work
Ensure labels is set as “host”.
Step 4: Register the Runner
Run the following command to register the runner with Gitea:
/usr/local/bin/act_runner --config /etc/act_runner/config.yaml register
You’ll be prompted to enter:
- Gitea instance URL
- Token
- Runner name (optional)
- Labels (use host)
After registration, a file named .runner will be created in the current directory (/etc/act_runner).
Step 5: Create a System User for the Runner
For better security and separation of privileges, create a dedicated system user:
#useradd --system --shell /usr/sbin/nologin --create-home act_runner
Give the user sudo privileges (needed for rsync and chown):
#visudo
Add the line:
act_runner ALL=(ALL) NOPASSWD:ALL
Also, create the required work directory:
#mkdir -p /home/act_runner/work
#chown -R act_runner:act_runner /home/act_runner
Step 6: Create Workflow File for Auto Deployment
Inside your Gitea repository, create the following directory structure:
#mkdir -p .gitea/workflows
#vim .gitea/workflows/deploy.yml
Paste this content:
name: Auto Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: host
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Rsync to Production
run: |
sudo rsync -av --delete ./ /home/giteatest2/public_html/
sudo chown -R giteatest2:giteatest2 /home/giteatest2/public_html/
Replace /home/giteatest2/public_html/ with your actual WordPress directory.
rsync: Syncs the codebase.
chown: Resets file ownership post-deployment.
Step 7: Reload and Restart the Act Runner Service:
#systemctl daemon-reexec
#systemctl daemon-reload
#systemctl restart act_runner
Step 8: Commit and Push Code
Push your website files from the working directory:
#su act_runner -
#cd /home/testdev/public_html/
#git init
#git remote add origin http://your-gitea-server/gituser/repo.git
#git add .
#git commit -m "Initial commit of WordPress site"
#git push -u origin main
To commit only the workflow file:
#git add .gitea/workflows/deploy.yml
#git commit -m "Add deployment workflow"
#git push
Once pushed, the act_runner will detect the change and deploy automatically!
Conclusion
With Gitea Runner configured, you now have a fully automated deployment pipeline for your WordPress site.
Every time you push changes to your repository, your server will pull the latest code, sync it to the production directory, and update file permissions — all without manual intervention.
Need expert help with Gitea Runner Deployment for WordPress? Our DevOps support services ensure seamless automation, fast deployment, and reliable performance. Contact us today to get started!