Skip to content

Docker Compose Test (PiHole) #1881

Docker Compose Test (PiHole)

Docker Compose Test (PiHole) #1881

name: "Docker Compose Test (PiHole)"
on:
pull_request:
branches: master
push:
branches: master
schedule:
- cron: "0 8 * * *"
env:
TARGET_SERVICE: pihole
TARGET_TIMEOUT: 120
jobs:
test:
runs-on: ubuntu-latest
steps:
-
name: "Git: Checkout"
uses: actions/checkout@v4
-
name: "Service: Setup"
run: |
cp .github/workflows/config/options.conf "${TARGET_SERVICE}/options.override.conf"
cp .github/workflows/config/options.conf "traefik/options.override.conf"
-
name: "Service: Start"
run: |
./comp up --skip-prereqs --labels no ${TARGET_SERVICE}
-
name: "Service: Wait"
run: |
cd ${TARGET_SERVICE} ; cat .env
sleep ${TARGET_TIMEOUT}s
-
name: "Service: Test"
run: |
if ! ./comp status --skip-prereqs ${TARGET_SERVICE}; then
docker ps
cd ${TARGET_SERVICE} ; docker compose logs
exit 1
fi
-
name: "Service: Restart with Traefik"
run: |
./comp down,up ${TARGET_SERVICE}
-
name: "Service: Wait"
run: |
sleep ${TARGET_TIMEOUT}s ; sleep ${TARGET_TIMEOUT}s
-
name: "Service: Test with Traefik"
run: |
if ! ./comp status ${TARGET_SERVICE} ; then
docker ps
cd ${TARGET_SERVICE} ; docker compose logs
cd traefik ; docker compose logs
exit 1
fi
cd traefik
docker compose exec -T traefik wget --spider --no-check-certificate https://127.0.0.1:9443/pihole/login.php \
|| (docker ps ; docker compose logs ; cd ../${TARGET_SERVICE} ; docker compose logs ; exit 1)