-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (71 loc) · 2.43 KB
/
AzureDeploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# To configure this workflow:
#
# 1. Set up a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE with the value of your Azure publish profile.
#
# 2. Change the values for the AZURE_WEBAPP_NAME, AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables (below).
#
# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
#
on:
push:
branches:
- demo
- dev
pull_request:
branches:
- master
- dev
release:
types: [created]
env:
BACKEND_AZURE_WEBAPP_NAME: thermaPollBackend # set this to your application's name
BACKEND_AZURE_WEBAPP_PACKAGE_PATH: './backend' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '12.14.0' # set this to the node version to use
FRONTEND_AZURE_WEBAPP_NAME: thermaPollFrontend
jobs:
build-frontend-and-deploy:
name: Build build-frontend-and-deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: yarn install, build
working-directory: ./frontend
env:
CI: false
PORT: 8080
run: |
yarn
yarn build
- name: 'Deploy to Azure WebApp'
uses: lauchacarro/[email protected]
with:
enabled-static-website: 'true'
folder: '/home/runner/work/Sweng-11/Sweng-11/frontend/build'
connection-string: ${{ secrets.STORAGE_CONNECTION_STRING }}
build-backend-and-deploy:
name: Build backend and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: yarn install, build, and test
working-directory: ./backend
run: |
# Build and test the project, then
# deploy to Azure Web App.
yarn
- name: 'Deploy to Azure WebApp'
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.BACKEND_AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: './backend'