Create lint_nginx.yml #1
Workflow file for this run
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: Nginx Config Linter | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| nginx-lint: | |
| name: Validate Nginx Config | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Nginx | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y nginx | |
| - name: Find and Test Nginx Config Files | |
| run: | | |
| set -e # Exit on error | |
| find . -name "reverse-proxy.conf" -print0 | while IFS= read -r -d '' file; do | |
| echo "Checking $file..." | |
| sudo nginx -t -c "$(realpath "$file")" | |
| done |