1.8 KiB
1.8 KiB
GitHub Actions Docker Publishing Setup
This repository includes a GitHub Actions workflow that automatically builds and publishes Docker images to GitHub Container Registry (GHCR).
Workflow Overview
The workflow (/.github/workflows/publish-docker.yml) automatically:
- Builds the Docker image using multi-platform support (AMD64 and ARM64)
- Publishes to
ghcr.io/sillyangel/mice - Tags images appropriately based on git refs
- Caches layers for faster subsequent builds
- Generates build provenance attestations for security
Trigger Conditions
The workflow runs on:
- Push to main/master branch → Creates
latesttag - Push tags (e.g.,
2025.07.02) → Creates date-based version tags - Pull requests → Creates PR-specific tags for testing
- Manual dispatch → Can be triggered manually from GitHub UI
Image Tags Generated
Based on different triggers, the workflow creates these tags:
Main Branch Push
ghcr.io/sillyangel/mice:latest
Tag Push (e.g., 2025.07.02)
ghcr.io/sillyangel/mice:2025.07.02ghcr.io/sillyangel/mice:latest
Pull Request
ghcr.io/sillyangel/mice:pr-123
Multi-Platform Support
The workflow builds for multiple architectures:
linux/amd64(Intel/AMD 64-bit)linux/arm64(ARM 64-bit, Apple Silicon, etc.)
Usage After Setup
Once the workflow is set up:
- Push to main → New
latestimage published - Create a release → Versioned images published
- Users can pull:
docker pull ghcr.io/sillyangel/mice:latest
Manual Image Building
You can also build and push manually:
# Build for multiple platforms
docker buildx build --platform linux/amd64,linux/arm64 \
-t ghcr.io/sillyangel/mice:latest \
--push .
# Login first (if needed)
echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin