User-defined Playground

Gitea Playground

Basically GiHub, but Open Source.

Startup configuration
dev-machine
gitea
runner-01
runner-02
Gitea playground: Basically GiHub, but Open Source.

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.

🔧 System Components

  • gitea: The Git hosting platform daemon running as a systemd service.

🛠️ Tools

  • tea: The official command-line client for Gitea.
  • git: Version control system for managing repositories.

🎯 Getting Started

Access the Web Interface

Gitea is accessible at: http://gitea.local

Pre-configured user account:

  • Username: laborant
  • Password: iximiuz

Create a new repository

# 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

Run Gitea Actions

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

📚 Learn More

Happy learning! 🚀

Start
Settings