File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -21,42 +21,43 @@ jobs:
2121          node-version : ' 20.x' 
2222          cache : ' npm' 
2323
24-       - name : Install dependencies 
25-         run : npm ci 
24+       - name : Clean npm cache 
25+         run : npm cache clean --force 
26+ 
27+       - name : Delete lock file and reinstall 
28+         run : | 
29+           rm -f package-lock.json 
30+           npm install 
2631
2732name : Build application 
2833        run : npm run build 
2934
30-       - name : Install serve globally for production 
31-         run : npm install -g serve 
32- 
3335      - name : Create production package.json 
3436        run : | 
35-           cat > package.json << EOF 
37+           cat > dist/ package.json << EOF 
3638          { 
3739            "name": "porfolio-production", 
3840            "version": "1.0.0", 
3941            "type": "module", 
4042            "scripts": { 
41-               "start": "npx serve -s dist  -l 0.0.0.0:\$PORT" 
43+               "start": "npx serve -s .  -l 0.0.0.0:\$PORT" 
4244            }, 
4345            "dependencies": { 
4446              "serve": "^14.2.4" 
4547            } 
4648          } 
4749          EOF 
4850
49- name : Install production dependencies 
50-         run : npm install --production 
51+ name : Install serve in dist directory 
52+         run : | 
53+           cd dist 
54+           npm install 
5155
5256name : Upload artifact 
5357        uses : actions/upload-artifact@v4 
5458        with :
5559          name : node-app 
56-           path : | 
57-             dist 
58-             package.json 
59-             node_modules 
60+           path : dist 
6061
6162  deploy :
6263    runs-on : ubuntu-latest 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments