extra debugs for deploying locally
This commit is contained in:
@@ -121,24 +121,38 @@ jobs:
|
||||
# ------------------------------------------------------------------
|
||||
- name: Deploy Locally
|
||||
run: |
|
||||
set -e # Exit script on first error
|
||||
#!/bin/bash -ex
|
||||
|
||||
# Set deployment path
|
||||
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
|
||||
echo "Pulling image ${{ gitea.sha }}..."
|
||||
docker pull ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }}
|
||||
|
||||
# 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
|
||||
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
|
||||
|
||||
echo "Bringing compose stack down and up with new image..."
|
||||
docker compose up -d --force-recreate --remove-orphans
|
||||
echo "Local deployment complete!"
|
||||
echo "--- Local deployment complete! ---"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user