Skip to content

Commit 04dc9e2

Browse files
authored
Update main_product-docs-prod.yml
1 parent 78acd2c commit 04dc9e2

File tree

1 file changed

+67
-66
lines changed

1 file changed

+67
-66
lines changed
Lines changed: 67 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,67 @@
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 - product-docs-prod
5-
6-
on:
7-
push:
8-
branches:
9-
- main
10-
workflow_dispatch:
11-
12-
jobs:
13-
build:
14-
runs-on: self-hosted
15-
permissions:
16-
contents: read
17-
18-
steps:
19-
- uses: actions/checkout@v4
20-
21-
22-
- name: Set up Node.js version
23-
uses: actions/setup-node@v3
24-
with:
25-
node-version: '22.x'
26-
27-
- name: npm install, build
28-
run: |
29-
npm install
30-
npm run build --if-present
31-
env:
32-
NODE_OPTIONS: "--max-old-space-size=16384"
33-
34-
- name: Upload artifact for deployment job
35-
uses: actions/upload-artifact@v4
36-
with:
37-
name: node-app
38-
path: ./build
39-
40-
deploy:
41-
runs-on: ubuntu-latest
42-
needs: build
43-
permissions:
44-
id-token: write
45-
contents: read
46-
47-
steps:
48-
- name: Download artifact from build job
49-
uses: actions/download-artifact@v4
50-
with:
51-
name: node-app
52-
53-
- name: Login to Azure
54-
uses: azure/login@v2
55-
with:
56-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_A214A3C0191244938C1F540AE0784B17 }}
57-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_5CCF304AF9F843A583AEF7B0F81ECA5F }}
58-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_46445F312B66482C990DC764E4218175 }}
59-
60-
- name: 'Deploy to Azure Web App'
61-
id: deploy-to-webapp
62-
uses: azure/webapps-deploy@v3
63-
with:
64-
app-name: 'product-docs-prod'
65-
slot-name: 'Production'
66-
package: .
1+
name: Build and deploy Node.js app to Azure Web App - product-docs-prod
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: self-hosted
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Node.js version
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '22.x'
22+
23+
- name: Install dependencies and build site
24+
run: |
25+
npm ci
26+
npm run build
27+
env:
28+
NODE_OPTIONS: "--max-old-space-size=16384"
29+
30+
- name: Zip build directory
31+
run: zip -r build.zip build
32+
33+
- name: Upload artifact for deployment job
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: node-app
37+
path: build.zip
38+
39+
deploy:
40+
runs-on: ubuntu-latest
41+
needs: build
42+
permissions:
43+
id-token: write
44+
contents: read
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
53+
run: unzip build.zip
54+
55+
- name: Login to Azure
56+
uses: azure/login@v2
57+
with:
58+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_A214A3C0191244938C1F540AE0784B17 }}
59+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_5CCF304AF9F843A583AEF7B0F81ECA5F }}
60+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_46445F312B66482C990DC764E4218175 }}
61+
62+
- name: Deploy to Azure Web App
63+
uses: azure/webapps-deploy@v3
64+
with:
65+
app-name: 'product-docs-prod'
66+
slot-name: 'Production'
67+
package: build

0 commit comments

Comments
 (0)