Skip to content

Commit bd4d80a

Browse files
Merge pull request #137 from farhadbahrehmandhenry/feature/issue133-team1-deploy-web-app
deploy web app to azure blob storage
2 parents a0e29b3 + 07946fb commit bd4d80a

File tree

9 files changed

+45
-34
lines changed

9 files changed

+45
-34
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.github/workflows/AzureDeploy.yml

-27
This file was deleted.

.github/workflows/deploy-ui.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# deploy to blob storage =>
2+
name: Build and deploy the app to the Azure Blob Storage
3+
4+
on:
5+
push:
6+
branches:
7+
- development
8+
env:
9+
AZURE_WEBAPP_PACKAGE_PATH: ui/react-ui
10+
NODE_VERSION: '10.x'
11+
12+
jobs:
13+
build-and-deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@main
17+
- name: Set up Node.js version
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{env.NODE_VERSION}}
21+
- name: npm install and build
22+
run: |
23+
cd ${{env.AZURE_WEBAPP_PACKAGE_PATH}}
24+
npm install
25+
npm run build
26+
- name: Upload To Azure Blob Storage
27+
uses: bacongobbler/[email protected]
28+
with:
29+
source_dir: ${{env.AZURE_WEBAPP_PACKAGE_PATH}}/build
30+
container_name: $web
31+
connection_string: ${{secrets.BLOB_STORAGE_CONNECTION_STRING}}

package-lock.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
.App {
2-
/* text-align: center; */
3-
/* height: 100vh; */
42
padding-top: 2rem;
53
padding-bottom: 2rem;
64
}

ui/react-ui/src/components/routes/userSingleTask/UserSingleTask.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let UserSingleTask = () => {
1010
console.log(userId, taskId)
1111

1212
useEffect(() => {
13-
fetch(`https://nsc-functionsapp-team1.azurewebsites.net/api/users/${userId}/tasks/${taskId}`)
13+
fetch(`https://nsc-fun-dev-usw2-thursday.azurewebsites.net/api/users/${userId}/tasks/${taskId}`)
1414
.then(response => response.json())
1515
.then(data => setUserSingleTask(data))
1616
.catch((error) => console.error(error))

ui/react-ui/src/components/routes/userTasks/UserTasks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var UserTasks = () => {
1111
useEffect(() => {
1212
setUserTasks(['loading']);
1313

14-
fetch(`https://nsc-functionsapp-team1.azurewebsites.net/api/users/${userId}/tasks?`)
14+
fetch(`https://nsc-fun-dev-usw2-thursday.azurewebsites.net/api/users/${userId}/tasks?`)
1515
.then(response => response.json())
1616
.then(data => setUserTasks(data))
1717
.catch((error) => console.error(error))

ui/react-ui/src/components/routes/userid/userid.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ var User = () => {
1010
var {userId} = useParams();
1111

1212
useEffect(() => {
13-
fetch(`https://nsc-functionsapp-team1.azurewebsites.net/api/users/${userId}?`)
13+
fetch(`https://nsc-fun-dev-usw2-thursday.azurewebsites.net/api/users/${userId}?`)
1414
.then(response => response.json())
15-
.then(data => setUser(data))
15+
.then(data => {
16+
var updatedData = {};
17+
18+
if (Object.keys(data).length > 0) Object.keys(data).forEach(key => updatedData[key.toLowerCase()] = data[key]);
19+
20+
setUser(updatedData);
21+
})
1622
.catch((error) => console.error(error))
1723

1824
// eslint-disable-next-line react-hooks/exhaustive-deps

ui/react-ui/src/components/routes/users/Users.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default class Users extends Component {
1111
};
1212

1313
async componentDidMount() {
14-
const url = 'https://nsc-functionsapp-team1.azurewebsites.net/api/users';
14+
const url = 'https://nsc-fun-dev-usw2-thursday.azurewebsites.net/api/users';
1515
const response = await fetch(url);
1616
const usersData = await response.json();
1717
this.setState({

0 commit comments

Comments
 (0)