Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 14ddfc0

Browse files
Add or update the Azure App Service build and deployment workflow config
1 parent 2c14397 commit 14ddfc0

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy Node.js app to Azure Web App - mywebappvisualizingdata2
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
permissions:
16+
contents: read #This is required for actions/checkout
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Node.js version
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '16.x'
25+
26+
- name: npm install, build, and test
27+
run: |
28+
npm install
29+
npm run build --if-present
30+
npm run test --if-present
31+
32+
- name: Upload artifact for deployment job
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: node-app
36+
path: .
37+
38+
deploy:
39+
runs-on: ubuntu-latest
40+
needs: build
41+
environment:
42+
name: 'Production'
43+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
44+
permissions:
45+
id-token: write #This is required for requesting the JWT
46+
contents: read #This is required for actions/checkout
47+
48+
steps:
49+
- name: Download artifact from build job
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: node-app
53+
54+
- name: Login to Azure
55+
uses: azure/login@v2
56+
with:
57+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_DF2C5B8B50F44CB288F76241500B96E2 }}
58+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_8FD63B165FC341A3B78EC653EEB84BF5 }}
59+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4D96714ABF234D1E8824F4860E73AC75 }}
60+
61+
- name: 'Deploy to Azure Web App'
62+
uses: azure/webapps-deploy@v3
63+
id: deploy-to-webapp
64+
with:
65+
app-name: 'mywebappvisualizingdata2'
66+
slot-name: 'Production'
67+
package: .
68+

0 commit comments

Comments
 (0)