Skip to content

Commit 86c48fa

Browse files
authored
ci: fix sample app for folder deployment (#2701)
1 parent 41df8a0 commit 86c48fa

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

.github/workflows/pr-chat.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Deploy pr mgt-chat
4+
name: Deploy mgt-chat sample app
55

66
on:
77
push:
@@ -36,6 +36,7 @@ jobs:
3636
cp samples/react-contoso/.env.sample samples/react-contoso/.env
3737
sed -i 's/REACT_APP_CLIENT_ID="00000000-0000-0000-0000-000000000000"/REACT_APP_CLIENT_ID="${{secrets.REACT_CONTOSO_CHAT}}"/g' samples/react-contoso/.env
3838
sed -i 's/REACT_APP_BACKEND_CLIENT_ID="00000000-0000-0000-0000-000000000000"/REACT_APP_BACKEND_CLIENT_ID="${{secrets.REACT_CONTOSO_CHAT_BACKEND}}"/g' samples/react-contoso/.env
39+
sed -i 's/REACT_APP_BASE_DIR="/"/REACT_APP_BASE_DIR="/next/mgt-chat""/g' samples/react-contoso/.env
3940
4041
- name: Build 🛠
4142
run: |
@@ -47,4 +48,4 @@ jobs:
4748
with:
4849
branch: gh-pages
4950
folder: samples/react-contoso/build
50-
target-folder: next/pr/mgt-chat
51+
target-folder: next/mgt-chat

.github/workflows/storybook.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ jobs:
4343
clean-exclude: |
4444
pr
4545
v3
46+
mgt-chat
4647
token: ${{ secrets.GITHUB_TOKEN }}

samples/react-contoso/.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ REACT_APP_SITE_NAME="Contoso Dashboard"
55
REACT_APP_CLIENT_ID="00000000-0000-0000-0000-000000000000"
66
REACT_APP_URL_AZURE_FUNCTION="https://contoso.azurewebsites.net"
77
REACT_APP_BACKEND_CLIENT_ID="00000000-0000-0000-0000-000000000000"
8+
REACT_APP_BASE_DIR="/"
89

samples/react-contoso/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "react-contoso",
33
"version": "1.3.0",
44
"private": true,
5+
"homepage": ".",
56
"dependencies": {
67
"@fluentui/merge-styles": "^8.0.3",
78
"@fluentui/react": "^8.0.0",

samples/react-contoso/src/Layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { HashRouter, Route, Switch } from 'react-router-dom';
2+
import { BrowserRouter, Route, Switch } from 'react-router-dom';
33
import { Header } from './components/Header';
44
import { SideNavigation } from './components/SideNavigation';
55
import { HomePage } from './pages/HomePage';
@@ -67,7 +67,7 @@ export const Layout: React.FunctionComponent = theme => {
6767
return (
6868
<FluentProvider theme={appContext.state.theme.fluentTheme}>
6969
<div className={styles.page}>
70-
<HashRouter>
70+
<BrowserRouter basename={process.env.BASE_DIR ?? '/'}>
7171
<Header></Header>
7272
<div className={styles.main}>
7373
<div
@@ -90,7 +90,7 @@ export const Layout: React.FunctionComponent = theme => {
9090
</Switch>
9191
</div>
9292
</div>
93-
</HashRouter>
93+
</BrowserRouter>
9494
</div>
9595
</FluentProvider>
9696
);

samples/react-contoso/src/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ brokerSettings.appId = process.env.REACT_APP_BACKEND_CLIENT_ID!;
2121
Providers.globalProvider = new Msal2Provider({
2222
clientId: process.env.REACT_APP_CLIENT_ID!,
2323
loginType: LoginType.Redirect,
24-
redirectUri: window.location.protocol + '//' + window.location.host,
2524
scopes: [
2625
'Bookmark.Read.All',
2726
'Calendars.Read',

0 commit comments

Comments
 (0)