-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.28 KB
/
traditional-api.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
name: Deploy Node.js to Azure Web App
on:
push:
branches:
- traditional-api
env:
AZURE_WEBAPP_NAME: app-traditiotal-api-eastus2
AZURE_WEBAPP_PACKAGE_PATH: "./code/traditional/traditional-api"
NODE_VERSION: "14.x"
jobs:
test-code:
name: Test code
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout from GitHub
uses: actions/checkout@master
- name: Run the tests
run: |
cd ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
npm install
npm run test --if-present
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout from GitHub
uses: actions/checkout@master
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: npm install, build
run: |
cd ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
npm install
- name: "Deploy to Azure WebApp"
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}