Skip to content

Commit

Permalink
Corrected env variable import in nginx config
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritzs committed Mar 11, 2025
1 parent cff718c commit a74d4d7
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions .github/workflows/update_primary_nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,33 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Check environment variables
run: env

# This is bad practise as environment variables should be stored in a secure location, but hey it works now.
# Can be fixed through utilizing predefined custom workflow, or github runners-secrets
- name: Export environment variables
run: |
export GROUP_ID="05"
export PORT_PREFIX="2"
export DEV_POSTFIX="1"
export STAG_POSTFIX="2"
export PROD_POSTFIX="3"
export GATEWAY_POSTFIX="6"
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}"
echo "DEV_PORT_PREFIX=$DEV_PORT_PREFIX" >> $GITHUB_ENV
echo "STAG_PORT_PREFIX=$STAG_PORT_PREFIX" >> $GITHUB_ENV
echo "PROD_PORT_PREFIX=$PROD_PORT_PREFIX" >> $GITHUB_ENV
echo "GATEWAY_POSTFIX=$GATEWAY_POSTFIX" >> $GITHUB_ENV
# - name: Export environment variables
# run: |
# export GROUP_ID="05"
# export PORT_PREFIX="2"
# export DEV_POSTFIX="1"
# export STAG_POSTFIX="2"
# export PROD_POSTFIX="3"
# export GATEWAY_POSTFIX="6"

# 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}"

# echo "DEV_PORT_PREFIX=$DEV_PORT_PREFIX" >> $GITHUB_ENV
# echo "STAG_PORT_PREFIX=$STAG_PORT_PREFIX" >> $GITHUB_ENV
# echo "PROD_PORT_PREFIX=$PROD_PORT_PREFIX" >> $GITHUB_ENV
# echo "GATEWAY_POSTFIX=$GATEWAY_POSTFIX" >> $GITHUB_ENV

- name: Replace environment variables in Nginx config
run: |
Expand Down

0 comments on commit a74d4d7

Please sign in to comment.