more ci/cd deploy fixes

This commit is contained in:
c-d-p
2025-04-22 23:24:11 +02:00
parent 2cc3e7c666
commit e15a5c7612

View File

@@ -74,12 +74,19 @@ jobs:
cd ${{ secrets.DEPLOY_PATH }}
echo "Logged into server: $(pwd)"
# Log into GHCR on mara
echo "Logging into GHCR..."
echo ${{ secrets.DOCKER_REGISTRY_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
echo "GHCR login completed."
# Pull the specific image version built in this workflow
# Using the Git SHA ensures we deploy exactly what was just built
echo "Pulling image ${{ github.sha }}..."
docker pull ghcr.io/${{ github.repository_owner }}/maia:${{ github.sha }}
# Also pull latest for other services to keep up to date
docker-compose pull redis db
docker compose pull redis db
# Uses sed to update the compose file with the new image tag
sed -i 's|image: ghcr.io/${{ github.repository_owner }}/maia:.*|image: ghcr.io/${{ github.repository_owner }}/maia:${{ github.sha }}|g' docker-compose.yml
@@ -87,5 +94,5 @@ jobs:
# Restart the services using the new image(s)
echo "Bringing compose stack down and up with new image..."
docker-compose up -d --force-recreate --remove-orphans api worker db redis
docker compose up -d --force-recreate --remove-orphans api worker db redis
echo "Deployment complete!"