From 8359a5b2472235127c3d83a9f0c34f75c8110c0d Mon Sep 17 00:00:00 2001 From: Ann-Marie Aeronuwy Francoise Revillard Date: Thu, 6 Mar 2025 11:50:13 +0100 Subject: [PATCH] Update update_primary_nginx.yml --- .github/workflows/update_primary_nginx.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 9733e17..159004a 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -23,9 +23,18 @@ jobs: #- name: Create temporary nginx config file # run: envsubst < ./nginx_template.txt > temp_default.conf # Maybe look at https://www.baeldung.com/linux/envsubst-command to get an idea - + - name: Create temporary nginx config file + run: envsubst '$REPLACE_ME $ANOTHER_VAR' < ./nginx_template.txt > temp_default.conf + - name: Copy temporary file to correct place - run: cp temp_default.conf /etc/nginx/conf.d/default.conf + run: sudo cp temp_default.conf /etc/nginx/conf.d/default.conf + #added sudo here - name: Show nginx file run: cat /etc/nginx/conf.d/default.conf + + - name: Test NGINX Configuration + run: sudo nginx -t + + - name: Restart NGINX + run: sudo systemctl reload nginx