Skip to content

Feat: workflow cp not mv #30

Feat: workflow cp not mv

Feat: workflow cp not mv #30

name: Deploy nginx configuration to TDT4242 server
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy-nginx:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Replace environment variables in Nginx config
run: |
envsubst '${DEV_PORT_PREFIX} ${PROD_PORT_PREFIX} ${STAG_PORT_PREFIX} ${GATEWAY_POSTFIX}' < nginx_template.txt > nginx_secfit.conf
sudo cp nginx_secfit.conf /etc/nginx/conf.d/nginx.conf
sudo nginx -t
# Restarting nginx service
- name: Restart nginx service
run: |
sudo systemctl restart nginx