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
2.3 KiB
2.3 KiB
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:
-
Trigger Conditions:
- Pushes to
mainormasterbranches - Pull requests targeting
mainormaster - Pushes of version tags (e.g.,
v1.0.0,v2.1.0)
- Pushes to
-
Job Steps:
- Checkout repository code
- Set up Go environment (version 1.25)
- Run
go mod tidyandgo 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:
- REGISTRY_USERNAME - Username for your container registry
- REGISTRY_PASSWORD - Password or access token for your container registry
- REGISTRY - The registry URL (e.g.,
docker.io,ghcr.io, or your private registry) - 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 URLIMAGE_NAME: Name of the Docker image
Customization
To customize the workflow:
- Change trigger branches: Modify the
branchesfilter in theonsection - Adjust Go version: Update the
go-versionin the setup-go step - Modify build arguments: Add build-args to the docker/build-push-action if needed
- 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:
- Check that all required secrets are set correctly
- Verify you have push permissions to the target registry
- Ensure Dockerfile is valid and builds locally
- Check the Actions tab in Gitea for detailed logs