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