extra debugs for deploying locally
Some checks failed
Build and Deploy Backend / Run Linters and Tests (push) Failing after 0s
Build and Deploy Backend / Build and Deploy (push) Has been skipped

This commit is contained in:
c-d-p
2025-04-30 21:50:19 +02:00
parent d74819ab58
commit ceef7f8a10

View File

@@ -121,24 +121,38 @@ jobs:
# ------------------------------------------------------------------ # ------------------------------------------------------------------
- name: Deploy Locally - name: Deploy Locally
run: | run: |
set -e # Exit script on first error #!/bin/bash -ex
# Set deployment path # Set deployment path
DEPLOY_PATH="/config/stacks/maia" DEPLOY_PATH="/config/stacks/maia"
echo "--- Start Deploy Locally ---"
echo "Workspace: $(pwd)"
echo "Checking existence of DEPLOY_PATH: ${DEPLOY_PATH}"
ls -la /config # Check if the parent dir exists
ls -la "${DEPLOY_PATH}" # Check if the target dir exists and list contents/permissions
# Pull the specific image version built in this workflow # Pull the specific image version built in this workflow
echo "Pulling image ${{ gitea.sha }}..." echo "Pulling image ${{ gitea.sha }}..."
docker pull ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }} docker pull ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }}
# Change to the directory containing the compose file # Change to the directory containing the compose file
cd ${{ DEPLOY_PATH }} echo "Changing directory to ${DEPLOY_PATH}"
cd "${DEPLOY_PATH}" || { echo "cd to ${DEPLOY_PATH} FAILED!"; exit 1; }
echo "Current directory: $(pwd)"
echo "Listing files in current directory:"
ls -la
# Pull the latest images for other services to ensure they stay up to date # Pull the latest images for other services to ensure they stay up to date
docker compose pull redis db echo "Pulling other compose services..."
docker compose -f docker-compose.yml pull redis db
echo "Other service pull complete."
echo "Running sed on docker-compose.yml..."
sed -i 's|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:.*|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }}|g' docker-compose.yml sed -i 's|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:.*|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }}|g' docker-compose.yml
echo "Bringing compose stack down and up with new image..." echo "Bringing compose stack down and up with new image..."
docker compose up -d --force-recreate --remove-orphans docker compose up -d --force-recreate --remove-orphans
echo "Local deployment complete!" echo "--- Local deployment complete! ---"