fix: Update CI/CD deployment to use active compose.yml file
- Fix deployment script to copy docker-compose.prod.yml to compose.yml (not docker-compose.yml) - Update all docker-compose commands to use -f compose.yml explicitly - Rename legacy deploy-synology/docker-compose.yml to .old - This should fix the deployment issue where VPS wasn't getting updated
This commit is contained in:
16
.github/workflows/ci-cd.yml
vendored
16
.github/workflows/ci-cd.yml
vendored
@@ -198,30 +198,30 @@ jobs:
|
|||||||
# Pull latest changes using Personal Access Token
|
# Pull latest changes using Personal Access Token
|
||||||
git pull https://$DEPLOY_TOKEN@github.com/remmerinio/stiftung-management-system.git main
|
git pull https://$DEPLOY_TOKEN@github.com/remmerinio/stiftung-management-system.git main
|
||||||
|
|
||||||
# Copy production docker compose file
|
# Copy production docker compose file to the active compose.yml
|
||||||
cp deploy-production/docker-compose.prod.yml docker-compose.yml
|
cp deploy-production/docker-compose.prod.yml compose.yml
|
||||||
|
|
||||||
# Login to GitHub Container Registry
|
# Login to GitHub Container Registry
|
||||||
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
echo $GITHUB_TOKEN | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
|
||||||
|
|
||||||
# Pull latest images
|
# Pull latest images
|
||||||
docker-compose pull
|
docker-compose -f compose.yml pull
|
||||||
|
|
||||||
# Stop containers
|
# Stop containers
|
||||||
docker-compose down
|
docker-compose -f compose.yml down
|
||||||
|
|
||||||
# Start containers with latest images
|
# Start containers with latest images
|
||||||
docker-compose up -d
|
docker-compose -f compose.yml up -d
|
||||||
|
|
||||||
# Wait for containers to be ready
|
# Wait for containers to be ready
|
||||||
echo "Waiting for containers to start..."
|
echo "Waiting for containers to start..."
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
# Run migrations
|
# Run migrations
|
||||||
docker-compose exec -T web python manage.py migrate
|
docker-compose -f compose.yml exec -T web python manage.py migrate
|
||||||
|
|
||||||
# Collect static files
|
# Collect static files
|
||||||
docker-compose exec -T web python manage.py collectstatic --noinput
|
docker-compose -f compose.yml exec -T web python manage.py collectstatic --noinput
|
||||||
|
|
||||||
# Show container status
|
# Show container status
|
||||||
docker-compose ps
|
docker-compose -f compose.yml ps
|
||||||
|
|||||||
Reference in New Issue
Block a user