diff --git a/.github/workflows/update_primary_nginx.yml b/.github/workflows/update_primary_nginx.yml index 1a1ec52..ca82e10 100644 --- a/.github/workflows/update_primary_nginx.yml +++ b/.github/workflows/update_primary_nginx.yml @@ -14,29 +14,29 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Load environment variables - run: | - export $(grep -v '^#' .env | xargs) - printenv | grep PORT_PREFIX # Debugging step to see if they are loaded + - name: Set up environment variables + uses: falti/dotenv-action@v1.1.4 + with: + export-variables: true + keys-case: bypass + + - name: Check environment variables + run: env - - name: Replace environment variables in Nginx config + # Copying nginx configuration file to the server + - name: Deploy nginx configuration file run: | - envsubst < nginx.conf.template > nginx.conf + sudo cp ./nginx_secfit.conf /etc/nginx/conf.d/nginx.conf # Test the nginx configuration - name: Test nginx configuration file run: | sudo nginx -t - # Copying nginx configuration file to the server - - name: Deploy nginx configuration file - run: | - sudo cp ./nginx_secfit.conf /etc/nginx/conf.d/nginx.conf - # Restarting nginx service - name: Restart nginx service run: | - sudo systemctl reload nginx + sudo systemctl restart nginx - name: Show deployed configuration run: |