Skip to content

Commit df09531

Browse files
committed
@torch2424 work on the new deployment workflow
1 parent f69cb85 commit df09531

2 files changed

Lines changed: 34 additions & 9 deletions

File tree

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# front
1+
# Gbdev Landing Page
22

3-
Source repository of the gbdev landing website. GitHub pages hosts the contents of the folder `docs/` (where we put the webpack build) on `gbdev.github.io/front`. `gbdev.github.io` redirects to `gbdev.github.io/front`.
3+
Source repository of the gbdev landing website. GitHub pages hosts the contents of the `master` branch which is then hoster on `gbdev.github.io`. Development is done on the `dev` branch due to Github's resctrition on branches for user pages.
44

55
Tools:
66

@@ -18,13 +18,25 @@ npm install
1818
npm run dev
1919
```
2020

21-
To build:
21+
To build production:
2222

2323
```bash
2424
# Run the webpack production build
2525
npm run build-prod
26-
# Move the result into the docs folder, so GitHub pages will see it
27-
mv dist/ docs/
2826
```
2927

28+
To serve a production copy:
29+
30+
```bash
31+
# Run the webpack production build, then serve on a local http-server with gzip on http://localhost:8080
32+
npm run serve-prod
33+
```
34+
35+
To deploy onto the master branch:
36+
```bash
37+
# Run the webpack production build, then place dist/ folder on the master branch
38+
npm run deploy
39+
```
40+
41+
3042
Webpack config was written from zero, so it still misses a lot of things.

package.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,33 @@
77
"author": "Antonio Vivace <avivace4@gmail.com>",
88
"license": "ISC",
99
"scripts": {
10-
"clean": "rm dist/bundle.js",
11-
"build-dev": "webpack -d --mode development",
12-
"build-prod": "webpack -p --mode production",
13-
"dev": "webpack-dev-server"
10+
"start": "npm run dev",
11+
"dev": "webpack-dev-server",
12+
"clean": "npx rimraf dist/*",
13+
"build-dev": "npx run-s clean build-copy-index build-dev-webpack",
14+
"build-prod": "npx run-s clean build-copy-index build-prod-webpack",
15+
"build-dev-webpack": "webpack -d --mode development",
16+
"build-prod-webpack": "webpack -p --mode production",
17+
"build-copy-index": "npx copyfiles index.html dist/",
18+
"serve-prod": "npx run-s build-prod serve-prod-server",
19+
"serve-prod-server": "npx ws -p 8080 -d dist -z",
20+
"deploy": "npx run-s build-prod deploy-gh-pages",
21+
"deploy-gh-pages": "npx gh-pages -d dist -b master"
1422
},
1523
"dependencies": {
1624
"typeface-cabin": "0.0.54"
1725
},
1826
"devDependencies": {
1927
"bulma": "^0.7.2",
28+
"copyfiles": "^2.1.0",
2029
"css-loader": "^1.0.1",
2130
"extract-text-webpack-plugin": "^4.0.0-beta.0",
2231
"file-loader": "^2.0.0",
32+
"gh-pages": "^2.0.1",
33+
"local-web-server": "^2.6.0",
2334
"node-sass": "^4.10.0",
35+
"npm-run-all": "^4.1.5",
36+
"rimraf": "^2.6.2",
2437
"sass-loader": "^7.1.0",
2538
"style-loader": "^0.23.1",
2639
"stylus": "^0.54.5",

0 commit comments

Comments
 (0)