mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2025-12-24 13:15:48 +00:00
33 lines
874 B
YAML
33 lines
874 B
YAML
name: Validate Nginx Configuration
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Trigger on push to main branch
|
|
pull_request:
|
|
branches:
|
|
- main # Trigger on pull request to main branch
|
|
|
|
jobs:
|
|
validate-nginx:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download WAF rules
|
|
run: |
|
|
wget https://github.com/fabriziosalmi/patterns/releases/download/latest/nginx_waf.zip -O nginx_waf.zip
|
|
unzip nginx_waf.zip -d waf_rules
|
|
|
|
- name: Combine Nginx configuration
|
|
run: |
|
|
cat nginx.conf waf_rules/*.conf > combined_nginx.conf
|
|
echo "Combined Nginx configuration:"
|
|
cat combined_nginx.conf
|
|
|
|
- name: Validate Nginx configuration using Docker
|
|
run: |
|
|
docker run --rm -v $(pwd)/combined_nginx.conf:/etc/nginx/nginx.conf:ro nginx nginx -t
|