Skip to content

Release Self-Hosted Images #19

Release Self-Hosted Images

Release Self-Hosted Images #19

name: Test Self-Hosted Docker Setup
on:
workflow_dispatch:
jobs:
test_docker_compose:
name: Test Docker Compose Setup
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Test docker-compose
working-directory: self-hosted/docker
env:
ACTIONS_USER_TIMEOUT_SECS: "20"
run: |
# Start services in the background
docker compose up -d
# Wait for services to be healthy and show logs while waiting
echo "Waiting for services to be healthy..."
attempt=1
max_attempts=30
while [ $attempt -le $max_attempts ]; do
if docker compose ps | grep -q "healthy"; then
echo "Services are healthy!"
break
fi
echo "Attempt $attempt/$max_attempts - Services not healthy yet"
echo "Docker compose status:"
docker compose ps
echo "Docker compose logs:"
docker compose logs --tail=50
sleep 2
attempt=$((attempt + 1))
done
if [ $attempt -gt $max_attempts ]; then
echo "Services failed to become healthy within timeout"
docker compose logs
exit 1
fi
# Give services a moment to fully initialize
sleep 5
echo "Testing backend version endpoint..."
curl http://localhost:3210/version || {
echo "Backend version check failed. Logs:"
docker compose logs
exit 1
}
echo "Testing dashboard endpoint..."
curl http://localhost:6791 || {
echo "Dashboard check failed. Logs:"
docker compose logs
exit 1
}
# Generate admin key
ADMIN_KEY=$(docker compose exec -T backend ./generate_admin_key.sh)
# Run integration tests
cd ../../npm-packages/js-integration-tests
npm ci
SKIP_INSTANCE_SECRET_TESTS=1 \
DEPLOYMENT_URL='http://127.0.0.1:3210' \
SITE_URL='http://127.0.0.1:3211' \
ADMIN_KEY="$ADMIN_KEY" \
npm run test-integration
# Stop services
cd ../../self-hosted/docker
docker compose down