Skip to content

Commit ec01ad0

Browse files
fix token substitution error
1 parent 253cecb commit ec01ad0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/contoso-traders-app-deployment.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,10 @@ jobs:
225225
steps:
226226
- name: checkout code
227227
uses: actions/checkout@v3
228-
- name: npm install
229-
run: npm install
230-
working-directory: src/ContosoTraders.Ui.Website
228+
- name: azure login
229+
uses: azure/login@v1
230+
with:
231+
creds: ${{ secrets.SERVICEPRINCIPAL }}
231232
- name: get carts api endpoint
232233
uses: azure/CLI@v1
233234
id: get-cartsApiEndpoint
@@ -241,19 +242,18 @@ jobs:
241242
- name: substitute tokens in ui configuration
242243
uses: cschleiden/replace-tokens@v1.2
243244
with:
244-
tokenPrefix: "{"
245-
tokenSuffix: "}"
245+
tokenPrefix: "{{"
246+
tokenSuffix: "}}"
246247
files: ./src/ContosoTraders.Ui.Website/src/services/configService.js
247248
env:
248249
CARTS_API_ENDPOINT: ${{ steps.get-cartsApiEndpoint.outputs.cartsApiEndpoint }}
249250
PRODUCTS_API_ENDPOINT: ${{ steps.get-productsApiEndpoint.outputs.productsApiEndpoint }}
251+
- name: npm install
252+
run: npm install
253+
working-directory: src/ContosoTraders.Ui.Website
250254
- name: npm run build
251255
run: npm run build
252256
working-directory: src/ContosoTraders.Ui.Website
253-
- name: azure login
254-
uses: azure/login@v1
255-
with:
256-
creds: ${{ secrets.SERVICEPRINCIPAL }}
257257
- name: deploy to storage
258258
uses: azure/CLI@v1
259259
with:

src/ContosoTraders.Ui.Website/src/services/configService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ require("dotenv").config();
44
const settingsUrl = "/api/settings";
55

66
// Note: The '{PRODUCTS_API_ENDPOINT}', '{CARTS_API_ENDPOINT}' tokens will be substituted by github workflow.
7-
const APIUrl = 'https://{PRODUCTS_API_ENDPOINT}/v1';
8-
const APIUrlShoppingCart = 'https://{CARTS_API_ENDPOINT}/v1';
7+
const APIUrl = 'https://{{PRODUCTS_API_ENDPOINT}}/v1';
8+
const APIUrlShoppingCart = 'https://{{CARTS_API_ENDPOINT}}/v1';
99
const UseB2C = '';//process.env.REACT_APP_USEB2C;
1010
const B2cAuthority = "https://login.microsoftonline.com/common";//process.env.REACT_APP_B2CAUTHORITY;
1111
const B2cClientId = "9db8d08a-d9b6-4e4c-8b46-a3898f985735";//process.env.REACT_APP_B2CCLIENTID;

0 commit comments

Comments
 (0)