Gitea (gitea.com and self-hosted)
OpsCrew supports repositories hosted on Gitea — both gitea.com and
self-hosted Gitea instances — through the same plan-and-approval safety model as GitHub.
Want OpsCrew to provision a hardened self-hosted Gitea on your server and connect your app with an API token and webhooks? See Self-hosted Gitea: provisioning and app integration.
Prerequisites
Section titled “Prerequisites”- Gitea version: Gitea 1.21+ for Actions secrets and variables, and 1.23+ for
triggering workflows through the API (
workflow_dispatch, required byopscrew rollback,opscrew promote, and OpsCrew cloud runs). - Gitea Actions enabled on the instance and repository, with at least one
act_runnerattached. - Personal Access Token (
GITEA_TOKEN): create one athttps://<your-gitea-host>/user/settings/applicationswith:write:repository(files, pull requests, deploy keys, Actions secrets/variables/runs/runners)write:package(container images in Gitea’s OCI package registry)
Remote detection
Section titled “Remote detection”opscrew init recognises Gitea automatically when origin points to:
gitea.com;- any hostname with a
giteaDNS label (for examplegitea.company.internal); - any custom hostname configured in
GITEA_HOST(or whenOPSCREW_GIT_PLATFORM=gitea).
export GITEA_TOKEN="<your-token>"# Optional for custom domains that do not contain "gitea":export GITEA_HOST="git.example.com"npx opscrew initDeploy workflow & secrets
Section titled “Deploy workflow & secrets”- OpsCrew renders the deploy workflow to
.gitea/workflows/opscrew-deploy.yml(and.gitea/workflows/opscrew-deploy-<env>.ymlfor additional environments), based on OpsCrew’s GitHub Actions workflow template. - Registry: images are pushed to your Gitea instance’s built-in OCI container registry
(
<host>/<owner>/<repo>, orcicd.registryHostwhen overridden). Both build and server-side deploy logins authenticate with${{ secrets.OPSCREW_REGISTRY_TOKEN || secrets.GITHUB_TOKEN }}(prefixed per environment outsideprod); exportOPSCREW_REGISTRY_TOKENwhen runningopscrew provisionif private registry access needs a package token. - Secrets: Gitea does not have deployment environments, so OpsCrew stores deploy secrets at
repository scope with per-environment prefixes (
OPSCREW_*for prod,OPSCREW_STAGING_*for staging). runs-onlabels: standard docker-mode jobs requestubuntu-latest; self-hosted OpsCrew server runners (environment.runner: server) requestopscrew-<app>-<env>directly.- Action mirrors: OpsCrew keeps commit-pinned shorthand action references, which respect your
Gitea instance’s
[actions] DEFAULT_ACTIONS_URLsetting (defaultgithub).
Live verification checklist
Section titled “Live verification checklist”Unit tests verify Gitea’s REST v1 API (including POST /actions/runners/registration-token and
workflow_dispatch), workflow rendering, and approval-gated provisioning against fake endpoints.
Before relying on a new Gitea instance:
- Run
npx opscrew initwithGITEA_TOKENand confirm it signs in against/api/v1/user. - Verify Actions Secrets and Variables are enabled on the repository.
- Confirm an
act_runnermatchingubuntu-latest(oropscrew-<app>-<env>:host) is online and can push tohttps://<host>/v2/<owner>/<repo>.