Skip to content

Setup nginx from the configuration file #9

Setup nginx from the configuration file

Setup nginx from the configuration file #9

name: Setup Nginx from 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:
export-variables: true
keys-case: bypass
- name: Generate Nginx config
run: |
envsubst '\$GROUP_ID \$DOMAIN \$URL_PREFIX \$PORT_PREFIX \$DEV_POSTFIX \$STAG_POSTFIX \$PROD_POSTFIX \$BACKEND_POSTFIX \$FRONTEND_POSTFIX \$GATEWAY_POSTFIX' < ./nginx_template.txt > temp_default.conf
- name: Copy Nginx config to correct place
run: sudo cp temp_default.conf /etc/nginx/conf.d/default.conf
- name: Show Nginx config
run: cat /etc/nginx/conf.d/default.conf
- name: Reload Nginx
run: sudo systemctl reload nginx