🐛 fix(cd): fix staging deployment registry authentication and missing images

Changes to .github/workflows/cd-staging.yml:
- Add Docker login step for GitHub Container Registry (ghcr.io)
- Add permissions for packages:read
- Update service deployment options to only include services with Dockerfiles
- Update health checks to match deployed services

Changes to docker-compose.staging.yml:
- Comment out services without Dockerfiles:
  - maerchenzauber-backend (no Dockerfile yet)
  - nutriphi-backend (no Dockerfile yet)
  - news-api (no Dockerfile yet)
- Keep only services with Docker images:
  - mana-core-auth 
  - chat-backend 
  - manadeck-backend 
- Update nginx dependencies to remove disabled services

This fixes the "error from registry: denied" error that was preventing
staging deployments. The deployment was trying to pull Docker images
that were never built because those services don't have Dockerfiles.

Now only services with actual Docker images will be deployed to staging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Wuesteon 2025-12-04 03:22:07 +01:00
parent a87e1389cf
commit f7986bc1a7
2 changed files with 99 additions and 88 deletions

View file

@ -10,13 +10,14 @@ on:
options:
- all
- mana-core-auth
- maerchenzauber-backend
- chat-backend
- manadeck-backend
- nutriphi-backend
- news-api
workflow_call:
permissions:
contents: read
packages: read
env:
NODE_VERSION: '20'
PNPM_VERSION: '9.15.0'
@ -96,6 +97,13 @@ jobs:
scp .env.staging ${{ secrets.STAGING_USER }}@${{ secrets.STAGING_HOST }}:~/manacore-staging/.env
rm .env.staging
- name: Login to GitHub Container Registry on staging server
run: |
ssh ${{ secrets.STAGING_USER }}@${{ secrets.STAGING_HOST }} << EOF
# Login to ghcr.io with GitHub token
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
EOF
- name: Pull latest Docker images
run: |
ssh ${{ secrets.STAGING_USER }}@${{ secrets.STAGING_HOST }} << 'EOF'
@ -132,8 +140,8 @@ jobs:
# Health check for each service
SERVICES=(
"mana-core-auth:3001:/api/v1/health"
"maerchenzauber-backend:3002:/health"
"chat-backend:3002:/api/health"
"manadeck-backend:3003:/api/health"
)
for SERVICE_CONFIG in "${SERVICES[@]}"; do