Skip to content

fix: add stub hosts for nginx upstream resolution in CI #3

fix: add stub hosts for nginx upstream resolution in CI

fix: add stub hosts for nginx upstream resolution in CI #3

Workflow file for this run

name: Validate docker-compose
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
APP_IMAGE: ghcr.io/rmdes/newsdiff:main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate docker-compose.yml
env:
ORIGIN: https://example.com
POSTGRES_PASSWORD: ci-test-password
run: docker compose config --quiet
- name: Check nginx config syntax
run: |
# Add stub DNS entries for upstream hosts so nginx -t doesn't fail on DNS
docker run --rm \
-v "$PWD/nginx.conf:/etc/nginx/nginx.conf:ro" \
--add-host app:127.0.0.1 \
--add-host bot:127.0.0.1 \
nginx:alpine nginx -t
- name: Verify GHCR image exists
run: |
echo "Checking $APP_IMAGE..."
docker manifest inspect "$APP_IMAGE" > /dev/null 2>&1 && echo "Image exists" || echo "::warning::Image not found on GHCR"