-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
Description
Implement a GitHub workflow that automatically builds and publishes container images to ghcr.io, manages versioning using Semantic Release, and creates GitHub releases based on conventional commits.
Tasks
- Set up GitHub Actions workflow file structure (High Priority)
- Configure Semantic Release (High Priority)
- Implement Docker image build step (High Priority)
- Configure GitHub Container Registry authentication (High Priority)
- Implement image tagging with semantic versions (Medium Priority)
- Add image push to GitHub Container Registry (High Priority)
- Configure Git tag creation (Medium Priority)
- Set up GitHub Release creation (Medium Priority)
- Implement PR trigger for workflow (Medium Priority)
- Add conventional commit validation (Low Priority)
- Create workflow documentation (Medium Priority)
- Set up required GitHub secrets (High Priority)
- Implement caching for Docker builds (Low Priority)
- Add workflow status badges (Low Priority)
Implementation Details
Workflow Overview
The workflow will:
- Trigger on pull request events
- Build the Docker image
- Use Semantic Release to determine the next version based on conventional commits
- Tag the image with the semantic version
- Push the image to GitHub Container Registry (ghcr.io)
- Create a Git tag for the version
- Generate a changelog
- Create a GitHub Release
Semantic Release Configuration
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}Docker Image Build and Push
# Example workflow step
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ steps.semantic.outputs.new_version }}
ghcr.io/${{ github.repository }}:latestRequired Secrets
GITHUB_TOKEN(with appropriate permissions)- Any additional secrets needed for the Docker build process
Acceptance Criteria
- Workflow successfully builds Docker images on PR events
- Images are correctly tagged with semantic versions
- Images are pushed to ghcr.io
- Git tags are created for each release
- GitHub Releases are created with changelogs
- Documentation is updated with workflow details
- Build caching is implemented for performance
- Status badges are added to the README