Skip to content

Commit 41df8a0

Browse files
authored
ci: add workflow to deploy mgt-chat sample app (#2699)
1 parent 32dcbc0 commit 41df8a0

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/pr-chat.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Deploy pr mgt-chat
5+
6+
on:
7+
push:
8+
branches: [next/mgt-chat]
9+
10+
jobs:
11+
react-contoso:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [16.x]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Install deps 🛠
27+
run: |
28+
echo "installing yarn"
29+
npm install -g yarn
30+
echo "installing deps for packages"
31+
yarn
32+
33+
- name: Setup env file
34+
shell: bash
35+
run: |
36+
cp samples/react-contoso/.env.sample samples/react-contoso/.env
37+
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
38+
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+
40+
- name: Build 🛠
41+
run: |
42+
yarn build
43+
yarn build:react-contoso
44+
45+
- name: Deploy mgt.dev/next/mgt-chat 🚀
46+
uses: JamesIves/[email protected]
47+
with:
48+
branch: gh-pages
49+
folder: samples/react-contoso/build
50+
target-folder: next/pr/mgt-chat

0 commit comments

Comments
 (0)