fix: Correct production deployment to use pre-built Docker images
CRITICAL: This fixes the deployment issue where changes weren't appearing on production Changes: - Update docker-compose.prod.yml to use ghcr.io pre-built images instead of local builds - Fix deployment script to pull latest images rather than building locally - Add proper GitHub Container Registry authentication - Remove --build flag that was causing deployment to use stale local code This should resolve the issue where www.vhtv-stiftung.de wasn't showing the new Verpachtung features.
This commit is contained in:
14
.github/workflows/ci-cd.yml
vendored
14
.github/workflows/ci-cd.yml
vendored
@@ -185,11 +185,13 @@ jobs:
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
env:
|
||||
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
with:
|
||||
host: ${{ secrets.PROD_HOST }}
|
||||
username: ${{ secrets.PROD_USERNAME }}
|
||||
key: ${{ secrets.PROD_SSH_KEY }}
|
||||
envs: DEPLOY_TOKEN
|
||||
envs: DEPLOY_TOKEN,GITHUB_TOKEN,GITHUB_ACTOR
|
||||
script: |
|
||||
cd /opt/stiftung
|
||||
|
||||
@@ -199,11 +201,17 @@ jobs:
|
||||
# Copy production docker compose file
|
||||
cp deploy-production/docker-compose.prod.yml docker-compose.yml
|
||||
|
||||
# Login to GitHub Container Registry
|
||||
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
||||
|
||||
# Pull latest images
|
||||
docker-compose pull
|
||||
|
||||
# Stop containers
|
||||
docker-compose down
|
||||
|
||||
# Start containers with rebuild
|
||||
docker-compose up -d --build
|
||||
# Start containers with latest images
|
||||
docker-compose up -d
|
||||
|
||||
# Wait for containers to be ready
|
||||
echo "Waiting for containers to start..."
|
||||
|
||||
Reference in New Issue
Block a user