mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 04:58:26 -04:00
simple test builds via GitHub Action
This commit is contained in:
parent
96ad258d36
commit
1747bdd149
41
.github/workflows/build.yml
vendored
Normal file
41
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Build Hugo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "12.x"
|
||||
# https://github.com/actions/cache/blob/master/examples.md#node---yarn
|
||||
# https://github.com/actions/cache/issues/60
|
||||
- name: Get yarn cache location
|
||||
id: yarn-cache
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||
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
|
||||
- uses: actions/upload-artifact@master
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
name: public
|
||||
path: './public'
|
13
package.json
13
package.json
@ -17,10 +17,12 @@
|
||||
"build": "yarn clean && yarn hugo:build && yarn optimize",
|
||||
"build:preview": "yarn clean && yarn hugo:build-dev",
|
||||
"hugo:build": "hugo --gc --cleanDestinationDir --verbose",
|
||||
"hugo:build-dev": "cross-env HUGO_ENV=development hugo -e development -b $DEPLOY_PRIME_URL --gc --cleanDestinationDir --buildDrafts --buildFuture --verbose",
|
||||
"hugo:serve": "hugo server --buildDrafts --buildFuture --renderToDisk --port 1313 --bind 0.0.0.0 --verbose",
|
||||
"docker:serve": "docker build -t jarv.is:develop -f Dockerfile . && docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop",
|
||||
"netlify:serve": "netlify dev --command 'yarn hugo:serve'",
|
||||
"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": "yarn optimize:html && yarn optimize:css && yarn optimize:img",
|
||||
"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",
|
||||
@ -28,8 +30,7 @@
|
||||
"lint": "yarn lint:markdown; yarn lint:sass",
|
||||
"lint:markdown": "markdownlint content/notes/**/*.md",
|
||||
"lint:sass": "stylelint assets/sass/**/* --syntax scss",
|
||||
"clean": "rimraf public/ resources/",
|
||||
"test": "hugo version; hugo env"
|
||||
"clean": "rimraf public/ resources/"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user