From d3940fcf3b90e031ecbf134c2ac05008bfa5b881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauritz=20Skog=C3=B8y?= Date: Mon, 3 Mar 2025 17:12:08 +0100 Subject: [PATCH] Third commit --- .github/workflows/update_primary_nginx.yml | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) 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