File tree Expand file tree Collapse file tree 3 files changed +43
-3
lines changed
Expand file tree Collapse file tree 3 files changed +43
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to Github Pages
2+
3+
4+ on :
5+ push :
6+ branches :
7+ - main
8+
9+ jobs :
10+ build-and-deploy :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : write
14+
15+ steps :
16+ - name : Set up Node.js
17+ uses : actions/setup-node@
18+ with :
19+ node-version : ' 18'
20+
21+ - name : Install dependencies
22+ run : npm install
23+
24+ - name : Build
25+ run : npm run build-prod
26+
27+ - name : Checkout
28+ run : actions/checkout@
29+
30+ - name : Deploy to Github Pages
31+ run : |
32+ # Overwrite gh-pages branch with current main branch.
33+ git checkout -B gh-pages
34+ # Build the minified file.
35+ npm run build-prod
36+ # Force ./docs to be added even though main has ./docs in its .gitignore
37+ git add -f ./docs
38+ git commit -m "Deploy to Github Pages"
39+ # Push
40+ git push -f origin gh-pages
Original file line number Diff line number Diff line change 22.git
33
44/node_modules /
5- /dist /
5+ /docs /
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ const devConfig = {
4343 mode : 'development' ,
4444 devtool : 'eval-source-map' ,
4545 output : {
46- path : path . resolve ( __dirname , 'dist ' ) ,
46+ path : path . resolve ( __dirname , 'docs ' ) ,
4747 filename : 'bundle.js' ,
4848 } ,
4949 devServer : {
@@ -61,7 +61,7 @@ const prodConfig = {
6161 mode : 'production' ,
6262 devtool : 'source-map' ,
6363 output : {
64- path : path . resolve ( __dirname , 'dist ' ) ,
64+ path : path . resolve ( __dirname , 'docs ' ) ,
6565 filename : 'bundle.[contenthash].js' ,
6666 } ,
6767 optimization : {
You can’t perform that action at this time.
0 commit comments