File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Deploy to GitHub Pages
2-
32on :
43 # Runs on pushes targeting the default branch
54 push :
6- branches : [ main ]
7-
5+ branches : ["main"]
86 # Allows you to run this workflow manually from the Actions tab
97 workflow_dispatch :
10-
118# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
129permissions :
1310 contents : read
1411 pages : write
1512 id-token : write
16-
1713# Allow only one concurrent deployment
1814concurrency :
1915 group : " pages"
2016 cancel-in-progress : true
21-
2217jobs :
23- build-and-deploy :
18+ # Build job
19+ build :
2420 runs-on : ubuntu-latest
25-
2621 steps :
27- - uses : actions/checkout@v4
28-
29- - name : Set up Node.js
30- uses : actions/setup-node@v3
22+ - name : Checkout
23+ uses : actions/checkout@v4
24+
25+ - name : Setup Node
26+ uses : actions/setup-node@v4
3127 with :
32- node-version : ' 20'
33-
28+ node-version : " 20"
29+ cache : npm
30+
3431 - name : Install dependencies
35- run : cd my-portfolio && npm install
36-
37- - name : Build
38- run : cd my-portfolio && npm run build
39-
40- - name : List directory structure
41- run : |
42- pwd
43- ls -la
44- ls -la my-portfolio/
45- ls -la my-portfolio/out || echo "out directory not found"
46-
47- - name : Deploy
48- uses : JamesIves/github-pages-deploy-action@v4
32+ run : npm ci
33+
34+ - name : Build with Next.js
35+ run : npm run build
36+
37+ - name : Upload artifact
38+ uses : actions/upload-pages-artifact@v3
4939 with :
50- folder : my-portfolio/out
51- branch : gh-pages
52-
40+ path : ./out
5341 # Deployment job
5442 deploy :
5543 environment :
5644 name : github-pages
5745 url : ${{ steps.deployment.outputs.page_url }}
5846 runs-on : ubuntu-latest
59- needs : build-and-deploy
47+ needs : build
6048 steps :
6149 - name : Deploy to GitHub Pages
6250 id : deployment
You can’t perform that action at this time.
0 commit comments