fix: add stub hosts for nginx upstream resolution in CI #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |