Skip to content

Commit

Permalink
Try again please
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritzs committed Mar 4, 2025
1 parent 89d29f0 commit edf100b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
29 changes: 19 additions & 10 deletions .github/workflows/update_primary_nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,31 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up environment variables
uses: falti/dotenv-action@v1.1.4
with:
export-variables: true
keys-case: bypass

# Copying nginx configuration file to the server
- name: Deploy nginx configuration file
- name: Export environment variables
run: |
sudo cp ./nginx_secfit.conf /etc/nginx/conf.d/nginx.conf
export URL_PREFIX=http://
export PORT_PREFIX=2
export DEV_POSTFIX=1
export STAG_POSTFIX=2
export PROD_POSTFIX=3
export DEV_PORT_PREFIX=${PORT_PREFIX}${GROUP_ID}${DEV_POSTFIX}
export STAG_PORT_PREFIX=${PORT_PREFIX}${GROUP_ID}${STAG_POSTFIX}
export PROD_PORT_PREFIX=${PORT_PREFIX}${GROUP_ID}${PROD_POSTFIX}
- name: Replace environment variables in Nginx config
run: |
envsubst < nginx_template > nginx.conf
# Test the nginx configuration
# 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: |
Expand Down
2 changes: 1 addition & 1 deletion nginx_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {
server {
listen ${DEV_PORT_PREFIX}7;
location / {
proxy_pass http://0.0.0.0:${DEV_PORT_PREFIX}${GATEWAY_POSTFIX}/;
proxy_pass http://0.0.0.0:${envDEV_PORT_PREFIX}${GATEWAY_POSTFIX}/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down

0 comments on commit edf100b

Please sign in to comment.