• Applicable Software: MokoGitea
  • Applicable Version: N/A

What are Gitea Actions?

Gitea Actions is MokoGitea's built-in CI/CD system. It uses a workflow syntax compatible with GitHub Actions, so if you've used GitHub Actions before, you'll feel right at home. Moko Consulting manages the runner infrastructure, so you can focus on writing your pipelines.

Creating Your First Workflow

  1. In your repository, create the directory .gitea/workflows/.
  2. Add a YAML file (e.g., ci.yaml) with your workflow definition.
  3. Commit and push — the workflow will run automatically.

Example: Basic CI Pipeline

name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install dependencies
        run: npm ci

      - name: Run tests
        run: npm test

Workflow Triggers

Control when workflows run using the on key:

  • push — Run on commits pushed to specified branches.
  • pull_request — Run when PRs are opened, updated, or synchronized.
  • schedule — Run on a cron schedule (e.g., nightly builds).
  • workflow_dispatch — Manually trigger from the MokoGitea UI.

Secrets and Variables

Store sensitive values (API keys, deployment credentials) as repository secrets:

  1. Go to Settings → Actions → Secrets.
  2. Click Add Secret.
  3. Enter a Name and Value.

Reference secrets in your workflow:

steps:
  - name: Deploy
    run: ./deploy.sh
    env:
      API_KEY: ${{ secrets.API_KEY }}

Viewing Workflow Results

Check the Actions tab in your repository to see:

  • A list of all workflow runs with status (success, failure, in progress).
  • Detailed logs for each step.
  • Re-run options for failed workflows.

Common Use Cases

  • Automated testing — Run unit tests on every push or PR.
  • Build and package — Compile code and create release artifacts.
  • Deployment — Deploy to staging or production on merge to main.
  • Linting — Check code style and formatting automatically.

Runner Infrastructure

Moko Consulting manages the Gitea Actions runners for your MokoGitea instance. If you need custom runners (e.g., for specialized build environments or GPU workloads), contact our support team.