This environment is set up for learning how to work with Gitea โ a painless self-hosted Git service that provides a GitHub-like experience for managing repositories, issues, and collaborative development workflows.
gitea: The Git hosting platform daemon running as a systemd service.tea: The official command-line client for Gitea.git: Version control system for managing repositories.Gitea is accessible at: http://gitea.local
Pre-configured user account:
laborantiximiuz# Create a new directory
mkdir test
cd test
# Initialize a new Git repository
git init
# Create a README file
echo "Hello world" > README.md
git add README.md
git commit -m "Initial commit"
export REPO=test-$(hostname)
# Create a new repository via tea CLI
tea repo create --name $REPO
# Push the repository to Gitea
git remote add origin "git@gitea.local:laborant/${REPO}.git"
git push -u origin main
The playground comes with runners configured for running Gitea Actions.
Create a workflow directory:
mkdir -p .gitea/workflows
Place a workflow file in the workflow directory:
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions ๐
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "๐ The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "๐ง This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "๐ The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "๐ก The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "๐ฅ๏ธ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "๐ This job's status is ${{ job.status }}."
Commit and push the changes:
git add .
git commit -m "add actions"
git push
Happy learning! ๐