Skip to content

Commit cf07d8f

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 7da7d81 commit cf07d8f

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 - insecureapi
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-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: '20.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: Zip artifact for deployment
33+
run: zip release.zip ./* -r
34+
35+
- name: Upload artifact for deployment job
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: node-app
39+
path: release.zip
40+
41+
deploy:
42+
runs-on: ubuntu-latest
43+
needs: build
44+
45+
46+
steps:
47+
- name: Download artifact from build job
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: node-app
51+
52+
- name: Unzip artifact for deployment
53+
run: unzip release.zip
54+
55+
- name: 'Deploy to Azure Web App'
56+
id: deploy-to-webapp
57+
uses: azure/webapps-deploy@v3
58+
with:
59+
app-name: 'insecureapi'
60+
slot-name: 'Production'
61+
package: .
62+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_77608686E17C45CF857136916FCD6EB5 }}

0 commit comments

Comments
 (0)