Skip to content

Commit 3ab6888

Browse files
authored
Update azure-webapps-node.yml
1 parent 2bcdcc3 commit 3ab6888

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

.github/workflows/azure-webapps-node.yml

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,64 +19,66 @@
1919

2020

2121

22-
name: Build and Deploy Node.js App to Azure
23-
24-
on:
2522

2623

2724

2825

2926

3027

31-
# @@ -83,3 +62,4 @@ jobs:
32-
28+
name: Build and Deploy Node.js App to Azure
29+
30+
on:
3331
push:
3432
branches: [ "master" ]
3533
workflow_dispatch:
34+
3635
env:
3736
AZURE_WEBAPP_NAME: recipe-for-success
3837
AZURE_WEBAPP_PACKAGE_PATH: '.'
3938
NODE_VERSION: '14.x'
39+
4040
permissions:
4141
contents: read
42+
4243
jobs:
4344
build:
4445
runs-on: ubuntu-latest
4546
steps:
46-
- uses: actions/checkout@v4
47-
- name: Set up Node.js
48-
uses: actions/setup-node@v3
49-
with:
50-
node-version: ${{ env.NODE_VERSION }}
51-
cache: 'npm'
52-
- name: Install Dependencies
53-
run: npm install
54-
- name: Build Application
55-
run: npm run build --if-present
56-
- name: Test Application
57-
run: npm run test --if-present
58-
- name: Upload artifact for deployment job
59-
uses: actions/upload-artifact@v3
60-
with:
61-
name: node-app
62-
path: .
47+
- uses: actions/checkout@v4
48+
- name: Set up Node.js
49+
uses: actions/setup-node@v3
50+
with:
51+
node-version: ${{ env.NODE_VERSION }}
52+
cache: 'npm'
53+
- name: Install Dependencies
54+
run: npm install
55+
- name: Build Application
56+
run: npm run build --if-present
57+
- name: Test Application
58+
run: npm run test --if-present
59+
- name: Upload artifact for deployment job
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: node-app
63+
path: .
64+
6365
deploy:
6466
permissions:
6567
contents: none
6668
runs-on: ubuntu-latest
6769
needs: build
6870
steps:
69-
- name: Download artifact from build job
70-
uses: actions/download-artifact@v3
71-
with:
72-
name: node-app
73-
- name: 'Login via Azure CLI'
74-
uses: azure/login@v1
75-
with:
76-
creds: ${{ secrets.AZURE_CREDENTIALS }}
77-
- name: 'Deploy to Azure WebApp'
78-
uses: azure/webapps-deploy@v2
79-
with:
80-
app-name: ${{ env.AZURE_WEBAPP_NAME }}
81-
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
82-
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
71+
- name: Download artifact from build job
72+
uses: actions/download-artifact@v3
73+
with:
74+
name: node-app
75+
- name: 'Login via Azure CLI'
76+
uses: azure/login@v1
77+
with:
78+
creds: ${{ secrets.AZURE_CREDENTIALS }}
79+
- name: 'Deploy to Azure WebApp'
80+
uses: azure/webapps-deploy@v2
81+
with:
82+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
83+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
84+
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

0 commit comments

Comments
 (0)