Skip to content

Commit

Permalink
Update update_primary_nginx.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jifollan authored and GitHub Enterprise committed Mar 20, 2025
1 parent 6bd5e71 commit 4da48cb
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/update_primary_nginx.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: Setup Nginx Configuration
name: Setup nginx from the configuration file

on:
workflow_dispatch:

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:
Expand All @@ -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

0 comments on commit 4da48cb

Please sign in to comment.