1.8 KiB
1.8 KiB
GitHub Container Registry Authentication Setup
Problem
The deployment pipeline fails to pull Docker images from GitHub Container Registry (GHCR) with error:
Error response from daemon: Head "https://ghcr.io/v2/remmerinio/stiftung-management-system/manifests/latest": denied: denied
Root Cause
The GITHUB_TOKEN used in GitHub Actions has limited permissions and cannot access private container packages.
Solution: Create Personal Access Token
1. Create GitHub Personal Access Token
- Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click "Generate new token (classic)"
- Select these scopes:
- ✅
read:packages- Download packages from GitHub Package Registry - ✅
write:packages- Upload packages to GitHub Package Registry - ✅
repo- Full control of private repositories (if repo is private)
- ✅
2. Add Token to Repository Secrets
- Go to your repository → Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
DEPLOY_TOKEN - Value: Your personal access token
- Click "Add secret"
3. Verify Token Works
Test the token manually:
echo "YOUR_TOKEN_HERE" | docker login ghcr.io -u YOUR_USERNAME --password-stdin
docker pull ghcr.io/remmerinio/stiftung-management-system:latest
Alternative: Make Container Package Public
- Go to GitHub → Your Profile → Packages
- Find
stiftung-management-systempackage - Click on it → Package settings
- Change visibility to "Public"
- No authentication needed for public packages
Deployment Script Improvements
The updated deployment script now:
- ✅ Uses
DEPLOY_TOKENinstead ofGITHUB_TOKEN - ✅ Has fallback to local build if GHCR pull fails
- ✅ Provides clear error messages
- ✅ Continues deployment even if registry is unavailable