Gitea is a painless self-hosted all-in-one software development service, it includes [Git](../../dev/Git.md) hosting, code review, team collaboration, package registry and CI/CD. It is similar to [GitHub](../development/GitHub.md), Bitbucket and GitLab.
Gitea Actions are available as a built-in CI/CD solution. It works just like [GitHub Actions](../../dev/GitHub%20Actions.md). You put your actions into `.gitea/workflows` inside your repository.
Just like other CI/CD solutions, Gitea doesn't run the jobs itself, but delegates the jobs to runners. The runner of Gitea Actions is called [act runner](https://gitea.com/gitea/act_runner), it is a standalone program and also written in Go. It is based on a [fork](https://gitea.com/gitea/act) of [nektos/act](http://github.com/nektos/act).
## Gitea Packages
A package always belongs to an owner (a user or organisation), not a repository. To link an (already uploaded) package to a repository, open the settings page on that package and choose a repository to link this package to. The entire package will be linked, not just a single version.
### Cargo Packages
Cargo stores information about the available packages in a package index stored in a [git](../../dev/Git.md) repository. In Gitea this repository has the special name `_cargo-index`. After a package was uploaded, its metadata is automatically written to the index. The content of this repository should not be manually modified.
The user or organization package settings page allows to create the index repository along with the configuration file. If needed this action will rewrite the configuration file. This can be useful if for example the Gitea instance domain was changed.
If the case arises where the packages stored in Gitea and the information in the index repository are out of sync, the settings page allows to rebuild the index repository. This action iterates all packages in the registry and writes their information to the index. If there are lot of packages this process may take some time.
To register the package registry the Cargo configuration must be updated. Add the following text to the configuration file located in the current users home directory (for example `~/.cargo/config.toml`):
```toml
[registry]
default = "gitea"
[registries.gitea]
index = "sparse+https://gitea.example.com/api/packages/{owner}/cargo/" # Sparse index
# index = "https://gitea.example.com/{owner}/_cargo-index.git" # Git
# [net]
# git-fetch-with-cli = true
```
If the registry is private or you want to publish new packages, you have to configure your credentials. Add the credentials section to the credentials file located in the current users home directory (for example `~/.cargo/credentials.toml`):
```toml
[registries.gitea]
token = "Bearer {token}"
```
Usage with cargo:
```sh
cargo publish
cargo add
cargo install
cargo yank
cargo unyank
cargo search
```
### Container Registry
Publish Open Container Initiative compliant images for your user or organization. The container registry follows the OCI specs and supports all compatible images like [Docker](../../tools/Docker.md) and Helm Charts.
To push an image or if the image is in a private registry, you have to authenticate:
Publish generic files, like release binaries or other output, for your user or organization.
To publish a generic package perform a [HTTP](../../internet/HTTP.md) PUT operation with the package content in the request body. You cannot publish a file with the same name twice to a package. You must delete the existing package version first.
```http
PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name}
```
Example request using [HTTP](../../internet/HTTP.md) Basic authentication:
To delete a file of a generic package perform a [HTTP](../../internet/HTTP.md) DELETE operation. This will delete the package version too if there is no file left.
To work with the Alpine registry, you need to use a [HTTP](../../internet/HTTP.md) client like [curl](../cli/network/curl.md) to upload and a package manager like apk to consume packages.
The Alpine registry files are signed with a [RSA](../../cryptography/RSA.md) key which must be known to apk. Download the public key and store it in `/etc/apk/keys/`:
To delete an Alpine package perform a [HTTP](../../internet/HTTP.md) `DELETE` operation. This will delete the package version too if there is no file left.
To display a [Markdown](../../files/Markdown.md) file in your Gitea profile page, simply create a repository named `.profile` and add a new file called `README.md`. Gitea will automatically display the contents of the file on your profile, above your repositories.