Skip to content

Commit ef1301a

Browse files
authored
Update azure-webapps-node.yml
1 parent 029cd3a commit ef1301a

1 file changed

Lines changed: 33 additions & 53 deletions

File tree

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

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,61 +37,41 @@ jobs:
3737
build:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@v4
41-
42-
- name: Set up Node.js
43-
uses: actions/setup-node@v4
44-
with:
45-
node-version: ${{ env.NODE_VERSION }}
46-
cache: 'npm'
47-
48-
- name: Install Dependencies
49-
run: npm install
50-
51-
- name: Build Application
52-
run: npm run build --if-present
53-
54-
- name: Test Application
55-
run: npm run test --if-present
56-
57-
- name: Upload artifact for deployment job
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: node-app
61-
path: .
62-
40+
- uses: actions/checkout@v4
41+
- name: Set up Node.js
42+
uses: actions/setup-node@v3
43+
with:
44+
node-version: ${{ env.NODE_VERSION }}
45+
cache: 'npm'
46+
- name: Install Dependencies
47+
run: npm install
48+
- name: Build Application
49+
run: npm run build --if-present
50+
- name: Test Application
51+
run: npm run test --if-present
52+
- name: Upload artifact for deployment job
53+
uses: actions/upload-artifact@v3
54+
with:
55+
name: node-app
56+
path: .
57+
6358
deploy:
6459
permissions:
65-
contents: read
66-
id-token: write # This is required for Azure login with OIDC
60+
contents: none
6761
runs-on: ubuntu-latest
6862
needs: build
69-
environment:
70-
name: 'production'
71-
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
72-
7363
steps:
74-
- name: Download artifact from build job
75-
uses: actions/download-artifact@v4
76-
with:
77-
name: node-app
78-
79-
- name: Login to Azure
80-
uses: azure/login@v1
81-
with:
82-
client-id: ${{ secrets.AZURE_CLIENT_ID }}
83-
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
84-
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
85-
86-
- name: 'Deploy to Azure WebApp'
87-
id: deploy-to-webapp
88-
uses: azure/webapps-deploy@v3
89-
with:
90-
app-name: ${{ env.AZURE_WEBAPP_NAME }}
91-
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
92-
93-
94-
95-
96-
97-
64+
- name: Download artifact from build job
65+
uses: actions/download-artifact@v3
66+
with:
67+
name: node-app
68+
- name: 'Login via Azure CLI'
69+
uses: azure/login@v1
70+
with:
71+
creds: ${{ secrets.AZURE_CREDENTIALS }}
72+
- name: 'Deploy to Azure WebApp'
73+
uses: azure/webapps-deploy@v2
74+
with:
75+
app-name: ${{ env.AZURE_WEBAPP_NAME }}
76+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
77+
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

0 commit comments

Comments
 (0)