From 4da48cb9218419c36e91eeb17f33fc78f89c5dcd Mon Sep 17 00:00:00 2001 From: Jonathan Inge Arvesen Folland Date: Thu, 20 Mar 2025 20:07:30 +0100 Subject: [PATCH] Update update_primary_nginx.yml --- .github/workflows/update_primary_nginx.yml | 26 +++++++++------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 4c6c258..7daf7e5 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -1,4 +1,4 @@ -name: Setup Nginx Configuration +name: Setup nginx from the configuration file on: workflow_dispatch: @@ -6,11 +6,10 @@ on: jobs: deploy: runs-on: self-hosted - + steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Dotenv Action uses: falti/dotenv-action@v1.1.4 with: @@ -19,18 +18,15 @@ jobs: - name: Check environment variables run: env + + - name: Create temporary nginx config file + run: envsubst '${PROD_PORT_PREFIX} ${GATEWAY_POSTFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX}' < nginx/nginx_template.txt > ./temp_default.conf + + - name: Copy temporary file to correct place + run: sudo cp ./temp_default.conf /etc/nginx/conf.d/nginx_securefit.conf - - name: Create temporary Nginx config file - run: envsubst '${PROD_PORT_PREFIX} ${DEV_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < nginx_template.txt > temp_nginx.conf - - - name: Copy Nginx Configuration to Server - run: sudo cp temp_nginx.conf /etc/nginx/conf.d/nginx_securefit.conf + - name: Verify nginx file + run: sudo cat /etc/nginx/conf.d/nginx_securefit.conf - - name: Show Nginx Configuration - run: cat /etc/nginx/conf.d/nginx_securefit.conf - - - name: Restart Nginx + - name: Restart nginx run: sudo systemctl reload nginx - - - name: Verify Nginx Configuration - run: sudo nginx -t