Skip to content

Commit fd4273c

Browse files
authored
Update azure-webapps-node.yml
1 parent b59109e commit fd4273c

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

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

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,33 @@ jobs:
2121
node-version: '20.x'
2222
cache: 'npm'
2323

24-
- name: Install and build
25-
run: |
26-
npm ci
27-
npm install terser --save-dev
28-
npm run build
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Build application
28+
run: npm run build
2929

30-
- name: Prepare deployment package
30+
- name: Install serve globally for production
31+
run: npm install -g serve
32+
33+
- name: Create production package.json
3134
run: |
32-
npm install serve --save
33-
npm pkg set scripts.start="npx serve -s dist -l $PORT"
34-
npm prune --production
35-
rm -rf .git .github .gitignore README.md *.md tests coverage
35+
cat > package.json << EOF
36+
{
37+
"name": "porfolio-production",
38+
"version": "1.0.0",
39+
"type": "module",
40+
"scripts": {
41+
"start": "npx serve -s dist -l 0.0.0.0:\$PORT"
42+
},
43+
"dependencies": {
44+
"serve": "^14.2.4"
45+
}
46+
}
47+
EOF
48+
49+
- name: Install production dependencies
50+
run: npm install --production
3651

3752
- name: Upload artifact
3853
uses: actions/upload-artifact@v4
@@ -41,7 +56,7 @@ jobs:
4156
path: |
4257
dist
4358
package.json
44-
package-lock.json
59+
node_modules
4560
4661
deploy:
4762
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)