fixed broken deploy.yml
Some checks failed
Build and Deploy Backend / Run Linters and Tests (Backend) (push) Successful in 17s
Build and Deploy Backend / Build (Frontend Web) (push) Successful in 54s
Build and Deploy Backend / Build Native Android App (EAS) (push) Successful in 46s
Build and Deploy Backend / Build (Backend) (push) Successful in 47s
Build and Deploy Backend / Deploy to Host (push) Failing after 2s

This commit is contained in:
c-d-p
2025-05-01 15:16:43 +02:00
parent 2db929289f
commit 682dc9a715

View File

@@ -218,7 +218,6 @@ jobs:
PEPPER: ${{ secrets.PEPPER }} PEPPER: ${{ secrets.PEPPER }}
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
run: | run: |
#!/bin/bash -ex #!/bin/bash -ex
@@ -226,9 +225,6 @@ jobs:
WORKSPACE_DIR="${{ gitea.workspace }}/backend" # Dir where deploy compose file lives WORKSPACE_DIR="${{ gitea.workspace }}/backend" # Dir where deploy compose file lives
COMPOSE_FILE="${WORKSPACE_DIR}/docker-compose.deploy.yml" COMPOSE_FILE="${WORKSPACE_DIR}/docker-compose.deploy.yml"
PROJECT_NAME="maia" # Project name used by docker compose PROJECT_NAME="maia" # Project name used by docker compose
BACKEND_IMAGE_TAG="${GITEA_SHA}"
FRONTEND_IMAGE_TAG="${GITEA_SHA}" # same tag for simplicity
echo "--- Start Deployment ---" echo "--- Start Deployment ---"
echo "Using compose file: ${COMPOSE_FILE}" echo "Using compose file: ${COMPOSE_FILE}"
@@ -239,13 +235,13 @@ jobs:
fi fi
# --- Pull specific backend image version --- # --- Pull specific backend image version ---
echo "Pulling backend image ${BACKEND_IMAGE_TAG}..." echo "Pulling backend image ${{ gitea.sha }}..."
docker pull ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia:${BACKEND_IMAGE_TAG} docker pull ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }}}
echo "Backend pull complete." echo "Backend pull complete."
# --- Pull specific frontend image version --- # --- Pull specific frontend image version ---
echo "Pulling frontend image ${FRONTEND_IMAGE_TAG}..." echo "Pulling frontend image ${{ gitea.sha }}..."
docker pull ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia-frontend:${FRONTEND_IMAGE_TAG} docker pull ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia-frontend:${{ gitea.sha }}
echo "Frontend pull complete." echo "Frontend pull complete."
# --- Pull other images defined in compose --- # --- Pull other images defined in compose ---
@@ -256,13 +252,13 @@ jobs:
# --- Update Backend image tag in compose file --- # --- Update Backend image tag in compose file ---
echo "Updating Backend image tag in ${COMPOSE_FILE##*/}..." echo "Updating Backend image tag in ${COMPOSE_FILE##*/}..."
sed -i "s|image: ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia:.*|image: ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia:${BACKEND_IMAGE_TAG}|g" "${COMPOSE_FILE##*/}" sed -i "s|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:.*|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:${{ gitea.sha }}|g" "${COMPOSE_FILE##*/}"
grep "image: ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia:" "${COMPOSE_FILE##*/}" || echo "Backend image line not found!" grep "image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia:" "${COMPOSE_FILE##*/}" || echo "Backend image line not found!"
# --- Update Frontend image tag in compose file --- # --- Update Frontend image tag in compose file ---
echo "Updating Frontend image tag in ${COMPOSE_FILE##*/}..." echo "Updating Frontend image tag in ${COMPOSE_FILE##*/}..."
sed -i "s|image: ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia-frontend:.*|image: ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia-frontend:${FRONTEND_IMAGE_TAG}|g" "${COMPOSE_FILE##*/}" sed -i "s|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia-frontend:.*|image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia-frontend:${{ gitea.sha }}|g" "${COMPOSE_FILE##*/}"
grep "image: ghcr.io/${DOCKER_REGISTRY_USERNAME}/maia-frontend:" "${COMPOSE_FILE##*/}" || echo "Frontend image line not found!" grep "image: ghcr.io/${{ secrets.DOCKER_REGISTRY_USERNAME }}/maia-frontend:" "${COMPOSE_FILE##*/}" || echo "Frontend image line not found!"
# --- Restart services using updated compose file --- # --- Restart services using updated compose file ---
echo "Bringing compose stack down and up for project ${PROJECT_NAME}..." echo "Bringing compose stack down and up for project ${PROJECT_NAME}..."