37 lines
908 B
YAML
37 lines
908 B
YAML
name: Verify configuration
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'bleeding-edge'
|
|
jobs:
|
|
verify-healthy:
|
|
runs-on: ubuntu:latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Start stack
|
|
run: docker compose up -d
|
|
|
|
- name: Show status
|
|
run: docker compose ps
|
|
|
|
- name: Check health
|
|
run: |
|
|
for i in {1..60}; do
|
|
status=$(docker inspect --format='{{if .State.Health}}{{.State.Health.Status}}{{else}}starting{{end}}' minecraftserver-mc-1 2>/dev/null || echo "missing")
|
|
if [ "$status" = "healthy" ]; then
|
|
echo "Server healthy"
|
|
exit 0
|
|
fi
|
|
sleep 5
|
|
done
|
|
|
|
echo "Server failed health check"
|
|
exit 1
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: docker compose down -v |