From e15a5c76122e452ed2ac5d074ea0423ec265a1d2 Mon Sep 17 00:00:00 2001 From: c-d-p Date: Tue, 22 Apr 2025 23:24:11 +0200 Subject: [PATCH] more ci/cd deploy fixes --- .github/workflows/deploy.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 16ab592..6381504 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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!" \ No newline at end of file