File tree Expand file tree Collapse file tree 1 file changed +26
-11
lines changed Expand file tree Collapse file tree 1 file changed +26
-11
lines changed Original file line number Diff line number Diff 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 
4156          path : | 
4257            dist 
4358            package.json 
44-             package-lock.json  
59+             node_modules  
4560
4661deploy :
4762    runs-on : ubuntu-latest 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments