mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 15:48:31 -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') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- run: yarn install --no-ignore-optional --frozen-lockfile
|
||||
- run: yarn hugo:version
|
||||
- run: yarn build:preview
|
||||
- run: yarn optimize
|
||||
- name: Install dependencies
|
||||
run: yarn install --no-ignore-optional --frozen-lockfile
|
||||
- name: Hugo version
|
||||
run: yarn debug:hugo
|
||||
- name: Build Hugo
|
||||
run: yarn build:preview
|
||||
- uses: actions/upload-artifact@master
|
||||
if: github.event_name == 'pull_request'
|
||||
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.
|
||||
|
||||
Simply run `yarn serve:docker` or build and run manually with:
|
||||
|
||||
```bash
|
||||
docker build -t jarv.is:develop -f Dockerfile .
|
||||
docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
||||
|
@ -1,5 +1,5 @@
|
||||
baseURL = "https://jarv.is/"
|
||||
languageCode = "en-US"
|
||||
languageCode = "en-us"
|
||||
title = "Jake Jarvis"
|
||||
|
||||
# increase timeout for image processing
|
||||
@ -7,9 +7,8 @@ timeout = 120000
|
||||
|
||||
canonifyURLs = true
|
||||
|
||||
disableFastRender = true
|
||||
disableHugoGeneratorInject = true # don't worry, inserted manually :)
|
||||
disableKinds = ["taxonomy", "taxonomyTerm"]
|
||||
disableHugoGeneratorInject = true # don't worry, inserted manually :)
|
||||
|
||||
pygmentsUseClasses = true
|
||||
pygmentsCodeFences = true
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
[build.environment]
|
||||
NODE_VERSION = "12.13.1"
|
||||
NPM_VERSION = "6.13.3"
|
||||
YARN_VERSION = "1.21.1"
|
||||
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"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn clean && yarn hugo:version && yarn hugo:build && yarn optimize",
|
||||
"build:preview": "yarn clean && yarn hugo:version && yarn hugo:build-dev",
|
||||
"hugo:build": "hugo --gc --cleanDestinationDir --verbose",
|
||||
"hugo:build-dev": "cross-env HUGO_ENV=development hugo -e development --buildDrafts --buildFuture --baseURL ${DEPLOY_PRIME_URL:-/} --gc --cleanDestinationDir --verbose",
|
||||
"hugo:version": "hugo version; hugo env",
|
||||
"start": "yarn serve:hugo",
|
||||
"serve:hugo": "hugo server --buildDrafts --buildFuture --port 1313 --bind 0.0.0.0 --verbose",
|
||||
"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",
|
||||
"clean": "rimraf public/ resources/",
|
||||
"build": "run-s clean hugo optimize",
|
||||
"build:preview": "run-s clean hugo:dev",
|
||||
"hugo": "hugo --gc --cleanDestinationDir --verbose",
|
||||
"hugo:dev": "hugo --environment development --baseURL \"${DEPLOY_PRIME_URL:-/}\" --buildDrafts --buildFuture --gc --cleanDestinationDir --verbose",
|
||||
"start": "hugo server --buildDrafts --buildFuture --port 1313 --bind 0.0.0.0 --verbose",
|
||||
"optimize": "run-p optimize:**",
|
||||
"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: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:sass": "stylelint assets/sass/**/* --syntax scss",
|
||||
"clean": "rimraf public/ resources/"
|
||||
"debug:hugo": "hugo version; hugo env",
|
||||
"debug:size": "get-folder-size --folder=public"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"clean-css-cli": "~4.3.0",
|
||||
"cross-env": "^6.0.3",
|
||||
"get-folder-size": "^2.0.1",
|
||||
"html-minifier": "~4.0.0",
|
||||
"hugo-bin": "0.48.1",
|
||||
@ -46,16 +43,15 @@
|
||||
"imagemin-pngquant": "^8.0.0",
|
||||
"imagemin-svgo": "^7.0.0",
|
||||
"markdownlint-cli": "~0.19.0",
|
||||
"netlify-cli": "^2.25.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"rimraf": "^3.0.0",
|
||||
"shx": "^0.3.2",
|
||||
"stylelint": "~12.0.0",
|
||||
"stylelint-config-recommended-scss": "~4.1.0",
|
||||
"stylelint-scss": "~3.13.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.13.0",
|
||||
"npm": "^6.13.0",
|
||||
"npm": "*** Use Yarn instead, please! https://yarnpkg.com/en/docs/cli/install ***",
|
||||
"yarn": "^1.19.2"
|
||||
},
|
||||
"hugo-bin": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user