diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 8f88b91..532846d 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -21,21 +21,24 @@ jobs: export-variables: true keys-case: bypass + # Test the nginx configuration + - name: Test nginx configuration + run: | + sudo nginx -t + # Copying nginx configuration file to the server - name: Deploy nginx configuration file run: | - sudo cp ./nginx/nginx.conf /etc/nginx/conf.d/nginx.conf + sudo cp ./nginx/nginx.conf /etc/nginx/nginx.conf # Main config + sudo cp ./nginx/nginx.conf /etc/nginx/conf.d/nginx.conf # Server block (if needed) + sudo chown root:root /etc/nginx/nginx.conf + sudo chmod 644 /etc/nginx/nginx.conf # Restarting nginx service - name: Restart nginx service run: | sudo systemctl reload nginx - # Test the nginx configuration - - name: Test nginx configuration - run: | - sudo nginx -t - - name: Show deployed configuration run: | cat /etc/nginx/conf.d/nginx.conf