@@ -9,34 +9,56 @@ permissions:
99 contents : write
1010 pages : write
1111 id-token : write
12- pull-requests : write
13- repository-projects : write
1412
1513jobs :
14+ # Build job
1615 build :
1716 runs-on : ubuntu-latest
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v4
20+
21+ - name : Setup pnpm
22+ uses : pnpm/action-setup@v4
23+ with :
24+ version : 9
25+
26+ - name : Install dependencies
27+ run : pnpm install --g gh-pages && pnpm install
28+
29+ - name : Build Docs
30+ run : pnpm build:docs
31+
32+ - name : Display structure of built files
33+ run : ls -R ./docs
1834
19- strategy :
20- matrix :
21- node-version : [20]
35+ - name : Upload artifact
36+ uses : actions/upload-pages-artifact@v3
37+ with :
38+ name : github-pages
39+ path : ./docs
40+
41+ # Deploy job
42+ deploy :
43+ environment :
44+ name : github-pages
45+ url : ${{ steps.deployment.outputs.page_url }}
46+ runs-on : ubuntu-latest
47+ needs : build
2248
2349 steps :
24- - uses : actions/checkout@v3
25-
26- - name : Use Node.js ${{ matrix.node-version }}
27- uses : actions/setup-node@v3
28- with :
29- node-version : ${{ matrix.node-version }}
30-
31- - name : Build
32- run : |
33- git config --global user.email "webdevnerdstuff@gmail.com"
34- git config --global user.name "WebDevNerdStuff"
35- mkdir docs
36- npm install --g gh-pages
37- npm i
38- npm run build:docs
39- git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
40- npm run deploy -u "github-actions-bot <support+actions@github.com>"
41- env :
42- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ - name : Checkout
51+ uses : actions/checkout@v4
52+
53+ - name : Download the build folder
54+ uses : actions/download-artifact@v4
55+ with :
56+ name : github-pages
57+ path : ./docs
58+
59+ - name : Display structure of downloaded files
60+ run : ls -R ./docs
61+
62+ - name : Deploy to GitHub Pages
63+ id : deployment
64+ uses : actions/deploy-pages@v4
0 commit comments