diff --git a/.github/actions/build-proxies/action.yml b/.github/actions/build-proxies/action.yml index eb3d9b82..7ad6ec43 100644 --- a/.github/actions/build-proxies/action.yml +++ b/.github/actions/build-proxies/action.yml @@ -25,14 +25,16 @@ runs: run: | make publish-oas - - name: Setup Proxy Name + - name: Setup Proxy Name and target shell: bash run: | if [ -z $PR_NUMBER ] then echo "INSTANCE=$PROXYGEN_API_NAME" >> $GITHUB_ENV + echo "TARGET=https://suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV else + echo "TARGET=https://pr$PR_NUMBER.suppliers.dev.nhsnotify.national.nhs.uk" >> $GITHUB_ENV echo "INSTANCE=$PROXYGEN_API_NAME-PR-$PR_NUMBER" >> $GITHUB_ENV fi @@ -52,6 +54,11 @@ runs: envsubst < ./.github/proxygen-settings.yaml > ${HOME}/.proxygen/settings.yaml envsubst < ./.github/proxygen-settings.yaml | cat + - name: Set target + shell: bash + run: | + jq --arg newurl "$TARGET" '.["x-nhsd-apim"].target.url = $newurl' build/notify-supplier.json > build/notify-supplier_target.json && mv build/notify-supplier_target.json build/notify-supplier.json + - name: Deploy to Internal Dev shell: bash