mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 08:58:30 -04:00
refactor npm build scripts
This commit is contained in:
parent
24f9e4eb16
commit
c7807a0ef1
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@ -31,10 +31,12 @@ jobs:
|
|||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
- run: yarn install --no-ignore-optional --frozen-lockfile
|
- name: Install dependencies
|
||||||
- run: yarn hugo:version
|
run: yarn install --no-ignore-optional --frozen-lockfile
|
||||||
- run: yarn build:preview
|
- name: Hugo version
|
||||||
- run: yarn optimize
|
run: yarn debug:hugo
|
||||||
|
- name: Build Hugo
|
||||||
|
run: yarn build:preview
|
||||||
- uses: actions/upload-artifact@master
|
- uses: actions/upload-artifact@master
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
with:
|
with:
|
||||||
|
@ -22,8 +22,6 @@ Run `yarn install` then `yarn start` ([Yarn must be installed](https://yarnpkg.c
|
|||||||
|
|
||||||
To ensure consistency and compatibility, the [`Dockerfile`](Dockerfile) in this repository will download the Hugo Extended binary and its dependencies, and start a live testing server.
|
To ensure consistency and compatibility, the [`Dockerfile`](Dockerfile) in this repository will download the Hugo Extended binary and its dependencies, and start a live testing server.
|
||||||
|
|
||||||
Simply run `yarn serve:docker` or build and run manually with:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t jarv.is:develop -f Dockerfile .
|
docker build -t jarv.is:develop -f Dockerfile .
|
||||||
docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
baseURL = "https://jarv.is/"
|
baseURL = "https://jarv.is/"
|
||||||
languageCode = "en-US"
|
languageCode = "en-us"
|
||||||
title = "Jake Jarvis"
|
title = "Jake Jarvis"
|
||||||
|
|
||||||
# increase timeout for image processing
|
# increase timeout for image processing
|
||||||
@ -7,9 +7,8 @@ timeout = 120000
|
|||||||
|
|
||||||
canonifyURLs = true
|
canonifyURLs = true
|
||||||
|
|
||||||
disableFastRender = true
|
|
||||||
disableHugoGeneratorInject = true # don't worry, inserted manually :)
|
|
||||||
disableKinds = ["taxonomy", "taxonomyTerm"]
|
disableKinds = ["taxonomy", "taxonomyTerm"]
|
||||||
|
disableHugoGeneratorInject = true # don't worry, inserted manually :)
|
||||||
|
|
||||||
pygmentsUseClasses = true
|
pygmentsUseClasses = true
|
||||||
pygmentsCodeFences = true
|
pygmentsCodeFences = true
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
[build.environment]
|
[build.environment]
|
||||||
NODE_VERSION = "12.13.1"
|
NODE_VERSION = "12.13.1"
|
||||||
NPM_VERSION = "6.13.3"
|
|
||||||
YARN_VERSION = "1.21.1"
|
YARN_VERSION = "1.21.1"
|
||||||
YARN_FLAGS = "--no-ignore-optional --frozen-lockfile"
|
YARN_FLAGS = "--no-ignore-optional --frozen-lockfile"
|
||||||
|
|
||||||
|
28
package.json
28
package.json
@ -14,28 +14,25 @@
|
|||||||
"url": "git+https://github.com/jakejarvis/jarv.is.git"
|
"url": "git+https://github.com/jakejarvis/jarv.is.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn clean && yarn hugo:version && yarn hugo:build && yarn optimize",
|
"clean": "rimraf public/ resources/",
|
||||||
"build:preview": "yarn clean && yarn hugo:version && yarn hugo:build-dev",
|
"build": "run-s clean hugo optimize",
|
||||||
"hugo:build": "hugo --gc --cleanDestinationDir --verbose",
|
"build:preview": "run-s clean hugo:dev",
|
||||||
"hugo:build-dev": "cross-env HUGO_ENV=development hugo -e development --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL:-/} --gc --cleanDestinationDir --verbose",
|
"hugo": "hugo --gc --cleanDestinationDir --verbose",
|
||||||
"hugo:version": "hugo version; hugo env",
|
"hugo:dev": "hugo --environment development --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture --gc --cleanDestinationDir --verbose",
|
||||||
"start": "yarn serve:hugo",
|
"start": "hugo server --buildDrafts --buildFuture --port 1313 --bind 0.0.0.0 --verbose",
|
||||||
"serve:hugo": "hugo server --buildDrafts --buildFuture --port 1313 --bind 0.0.0.0 --verbose",
|
"optimize": "run-p optimize:**",
|
||||||
"serve:docker": "docker build -t jarv.is:develop -f Dockerfile . && docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop",
|
|
||||||
"serve:netlify": "netlify dev --command 'yarn serve:hugo'",
|
|
||||||
"optimize": "get-folder-size --folder=public; yarn optimize:html && yarn optimize:css && yarn optimize:img; get-folder-size --folder=public",
|
|
||||||
"optimize:html": "html-minifier --html5 --collapse-whitespace --preserve-line-breaks --minify-css --file-ext html --input-dir public --output-dir public **/*.html",
|
"optimize:html": "html-minifier --html5 --collapse-whitespace --preserve-line-breaks --minify-css --file-ext html --input-dir public --output-dir public **/*.html",
|
||||||
"optimize:css": "cleancss -O0 --format 'keep-breaks' -o public/style.css public/style.css",
|
"optimize:css": "cleancss -O0 --format 'keep-breaks' -o public/style.css public/style.css",
|
||||||
"optimize:img": "find public -type d | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin=pngquant --plugin=optipng --plugin=svgo --plugin=gifsicle --out-dir={}",
|
"optimize:img": "find public -type d | xargs -n1 -P8 -I{} imagemin {}/* --plugin=jpegoptim --plugin=pngquant --plugin=optipng --plugin=svgo --plugin=gifsicle --out-dir={}",
|
||||||
"lint": "yarn lint:markdown; yarn lint:sass",
|
"lint": "run-p lint:**",
|
||||||
"lint:markdown": "markdownlint content/notes/**/*.md",
|
"lint:markdown": "markdownlint content/notes/**/*.md",
|
||||||
"lint:sass": "stylelint assets/sass/**/* --syntax scss",
|
"lint:sass": "stylelint assets/sass/**/* --syntax scss",
|
||||||
"clean": "rimraf public/ resources/"
|
"debug:hugo": "hugo version; hugo env",
|
||||||
|
"debug:size": "get-folder-size --folder=public"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"clean-css-cli": "~4.3.0",
|
"clean-css-cli": "~4.3.0",
|
||||||
"cross-env": "^6.0.3",
|
|
||||||
"get-folder-size": "^2.0.1",
|
"get-folder-size": "^2.0.1",
|
||||||
"html-minifier": "~4.0.0",
|
"html-minifier": "~4.0.0",
|
||||||
"hugo-bin": "0.48.1",
|
"hugo-bin": "0.48.1",
|
||||||
@ -46,16 +43,15 @@
|
|||||||
"imagemin-pngquant": "^8.0.0",
|
"imagemin-pngquant": "^8.0.0",
|
||||||
"imagemin-svgo": "^7.0.0",
|
"imagemin-svgo": "^7.0.0",
|
||||||
"markdownlint-cli": "~0.19.0",
|
"markdownlint-cli": "~0.19.0",
|
||||||
"netlify-cli": "^2.25.0",
|
"npm-run-all": "^4.1.5",
|
||||||
"rimraf": "^3.0.0",
|
"rimraf": "^3.0.0",
|
||||||
"shx": "^0.3.2",
|
|
||||||
"stylelint": "~12.0.0",
|
"stylelint": "~12.0.0",
|
||||||
"stylelint-config-recommended-scss": "~4.1.0",
|
"stylelint-config-recommended-scss": "~4.1.0",
|
||||||
"stylelint-scss": "~3.13.0"
|
"stylelint-scss": "~3.13.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.13.0",
|
"node": ">=12.13.0",
|
||||||
"npm": "^6.13.0",
|
"npm": "*** Use Yarn instead, please! https://yarnpkg.com/en/docs/cli/install ***",
|
||||||
"yarn": "^1.19.2"
|
"yarn": "^1.19.2"
|
||||||
},
|
},
|
||||||
"hugo-bin": {
|
"hugo-bin": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user