Add Gitea Actions CI/CD for automated Docker builds
- Add .gitea/workflows/docker.yml: builds and pushes Docker image on Git tags with semantic versioning (v0.1.0 → tags 0.1.0, 0.1, latest) - Add .dockerignore to optimize Docker build context - Document release process in docs/DEVELOPMENT.md - Update CHANGELOG.md with v0.1.0 release and Unreleased CI/CD entry Required Gitea secrets: REGISTRY_USERNAME, REGISTRY_PASSWORD Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
@@ -91,6 +91,59 @@ docker run -d \
|
||||
htop-web
|
||||
```
|
||||
|
||||
## Release process
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Gitea Actions runner must be configured and running.
|
||||
- Repository secrets `REGISTRY_USERNAME` and `REGISTRY_PASSWORD` must be set in **Settings → Secrets** of the Gitea repository. These credentials are used to authenticate with the Gitea Container Registry.
|
||||
|
||||
### Creating a release
|
||||
|
||||
1. **Update `CHANGELOG.md`** with changes for the new version.
|
||||
|
||||
2. **Commit and push** your changes:
|
||||
|
||||
```bash
|
||||
git add -A
|
||||
git commit -m "Prepare release v0.2.0"
|
||||
git push origin master
|
||||
```
|
||||
|
||||
3. **Create and push a Git tag** with Semantic Versioning:
|
||||
|
||||
```bash
|
||||
git tag -a v0.2.0 -m "Release v0.2.0: new features and fixes"
|
||||
git push origin v0.2.0
|
||||
```
|
||||
|
||||
4. **Gitea Actions** will automatically:
|
||||
- Build the Docker image using the multi-stage Dockerfile
|
||||
- Tag it with the version (`0.2.0`), minor version (`0.2`), and `latest`
|
||||
- Push all three tags to the Gitea Container Registry
|
||||
|
||||
### Docker image tags
|
||||
|
||||
Each release produces three Docker image tags:
|
||||
|
||||
| Tag | Example | Description |
|
||||
|-----|---------|-------------|
|
||||
| Full version | `gitea.jambotron.com/liosha84/htop-web:0.2.0` | Exact version, use in production |
|
||||
| Minor version | `gitea.jambotron.com/liosha84/htop-web:0.2` | Latest patch of 0.2.x |
|
||||
| Latest | `gitea.jambotron.com/liosha84/htop-web:latest` | Most recent stable release |
|
||||
|
||||
### Using a specific version in production
|
||||
|
||||
In `docker-compose.yml`, always pin to a specific version:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
htop-web:
|
||||
image: gitea.jambotron.com/liosha84/htop-web:0.2.0
|
||||
```
|
||||
|
||||
Avoid using `:latest` in production — it makes rollbacks impossible and breaks reproducibility.
|
||||
|
||||
## Contribution guidelines
|
||||
|
||||
- Keep changes focused and reviewable.
|
||||
|
||||
Reference in New Issue
Block a user