Skip to content

Setup nginx from the configuration file #14

Setup nginx from the configuration file

Setup nginx from the configuration file #14

name: Setup Nginx from Configuration Files
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:
export-variables: true
keys-case: bypass
- name: Generate Nginx config
run: |
envsubst '\$PROD_GATEWAY_PORT \$DEV_GATEWAY_PORT \$STAG_GATEWAY_PORT' < ./nginx_template.txt > temp_default.conf
- name: Copy Nginx config files
run: |
sudo cp temp_default.conf /etc/nginx/conf.d/default.conf
sudo cp nginx_securefit.conf /etc/nginx/conf.d/nginx_securefit.conf
- name: Show Nginx config files
run: |
cat /etc/nginx/conf.d/default.conf
cat /etc/nginx/conf.d/nginx_securefit.conf
- name: Test Nginx configuration
run: sudo nginx -t
- name: Reload Nginx
run: sudo systemctl reload nginx