Some checks failed
Build and Push Docker Image / build (pull_request) Failing after 38s
This commit includes: 1. Live/Remix Filtering Feature: - Added ignore_live and ignore_remix columns to artist_settings table (migration 010) - Updated ArtistSettings struct with IgnoreLive and IgnoreRemix fields - Modified SaveArtistSettings and UpdateArtistSettings to handle new fields - Extended FilterOptions struct with IgnoreLive and IgnoreRemix - Updated ApplyTypeToggles and ApplyTypeTogglesToReleaseGroups to filter Live/Remix types - Added toggleIgnoreLive and toggleIgnoreRemix handlers in web layer - Updated ArtistData view model and artist.html template with new toggle UI - Comprehensive test coverage for all new functionality 2. CI/CD Pipeline with Gitea Actions: - Added .gitea/workflows/docker-build.yml for automated Docker builds - Workflow triggers on pushes to main/master and tags, plus PRs - Runs Go tests before building - Builds and pushes multi-architecture Docker images to gitea.mrixs.me - Includes caching for faster subsequent builds - Proper tagging strategy (branch, semver, SHA) - CI-CD-GUIDE.md documentation 3. Cleanup: - Removed temporary build artifacts and coverage files
70 lines
2.3 KiB
Markdown
70 lines
2.3 KiB
Markdown
# CI/CD with Gitea Actions for NaviWatcher
|
|
|
|
This repository uses Gitea Actions to automatically build and publish Docker images.
|
|
|
|
## Workflow Overview
|
|
|
|
The workflow (`.gitea/workflows/docker-build.yml`) performs the following steps:
|
|
|
|
1. **Trigger Conditions**:
|
|
- Pushes to `main` or `master` branches
|
|
- Pull requests targeting `main` or `master`
|
|
- Pushes of version tags (e.g., `v1.0.0`, `v2.1.0`)
|
|
|
|
2. **Job Steps**:
|
|
- Checkout repository code
|
|
- Set up Go environment (version 1.25)
|
|
- Run `go mod tidy` and `go mod verify`
|
|
- Execute unit tests with coverage
|
|
- Set up Docker Buildx for multi-platform builds
|
|
- Authenticate with container registry
|
|
- Extract metadata for image tagging
|
|
- Build and push Docker image to registry
|
|
|
|
## Required Secrets
|
|
|
|
To use this workflow, you need to configure the following secrets in your Gitea repository:
|
|
|
|
1. **REGISTRY_USERNAME** - Username for your container registry
|
|
2. **REGISTRY_PASSWORD** - Password or access token for your container registry
|
|
3. **REGISTRY** - The registry URL (e.g., `docker.io`, `ghcr.io`, or your private registry)
|
|
4. **IMAGE_NAME** - The name for your Docker image (e.g., `naviwatcher`)
|
|
|
|
## Environment Variables
|
|
|
|
The workflow uses these environment variables (can be configured in the workflow or repository settings):
|
|
|
|
- `REGISTRY`: Container registry URL
|
|
- `IMAGE_NAME`: Name of the Docker image
|
|
|
|
## Customization
|
|
|
|
To customize the workflow:
|
|
|
|
1. **Change trigger branches**: Modify the `branches` filter in the `on` section
|
|
2. **Adjust Go version**: Update the `go-version` in the setup-go step
|
|
3. **Modify build arguments**: Add build-args to the docker/build-push-action if needed
|
|
4. **Change registry**: Update the REGISTRY environment variable and corresponding secrets
|
|
|
|
## Example Configuration
|
|
|
|
For Docker Hub:
|
|
- REGISTRY: `docker.io`
|
|
- IMAGE_NAME: `yourusername/naviwatcher`
|
|
|
|
For GitHub Container Registry:
|
|
- REGISTRY: `ghcr.io`
|
|
- IMAGE_NAME: `username/naviwatcher`
|
|
|
|
For GitLab Container Registry:
|
|
- REGISTRY: `registry.gitlab.com`
|
|
- IMAGE_NAME: `group/project/naviwatcher`
|
|
|
|
## Troubleshooting
|
|
|
|
If builds fail:
|
|
|
|
1. Check that all required secrets are set correctly
|
|
2. Verify you have push permissions to the target registry
|
|
3. Ensure Dockerfile is valid and builds locally
|
|
4. Check the Actions tab in Gitea for detailed logs |