diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 91bc87d..3a2f957 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -13,20 +13,29 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Dotenv Action + + # Setting up env variables + - name: Env variables uses: falti/dotenv-action@v1.1.4 with: export-variables: true keys-case: bypass + # Copying nginx configuration file to the server - name: Deploy nginx configuration file run: | - sudo cp ./nginx/nginx.conf /etc/nginx/conf.d/default.conf + sudo cp ./nginx.conf /etc/nginx/conf.d/nginx.conf + + # Restarting nginx service + - name: Restart nginx service + run: | sudo systemctl reload nginx - - name: Show nginx file + # Test the nginx configuration + - name: Test nginx configuration + run: | + sudo nginx -t + + - name: Show deployed configuration run: | - cat /etc/nginx/conf.d/default.conf - sudo nginx -t - sudo systemctl status nginx - echo "Nginx is running correctly" + cat /etc/nginx/conf.d/nginx.conf