1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 05:18:28 -04:00

try to speed up builds

This commit is contained in:
Jake Jarvis 2019-11-11 10:49:11 -05:00
parent f2fb8e812c
commit 6f62c4dff5
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
6 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@ I keep an ongoing list of [blog post ideas](https://github.com/jakejarvis/jarv.i
This site runs a [custom version](https://github.com/jakejarvis/hugo-custom) of [Hugo Extended](https://github.com/gohugoio/hugo) with a few (very opinionated) changes. To ensure consistency, the [`Dockerfile`](Dockerfile) in this repository will pull my Hugo [fork](https://github.com/jakejarvis/hugo-custom) (forked from `v0.53-DEV`, [gohugo/hugo@`a28865c`](https://github.com/gohugoio/hugo/tree/a28865cfc3e296cf0ddd0bd6c1368fcdb2154d0f) and pre-built on [Docker Hub](https://hub.docker.com/r/jakejarvis/hugo-custom) and [GitHub Package Registry](https://github.com/jakejarvis/hugo-custom/packages)) and run a live testing server.
Run these commands on the root of this repository:
Run [`./scripts/docker-server.sh`](scripts/docker-server.sh) from the root of this repository, or execute these Docker commands:
```bash
docker build -t jarv.is:develop -f Dockerfile .

View File

@ -1,6 +1,6 @@
# netlify.sh downloads my custom Hugo fork and builds the site independently.
[build]
command = "./scripts/netlify.sh"
command = "./scripts/netlify-build.sh"
publish = "public"
@ -18,11 +18,11 @@
[[redirects]]
from = "/feed"
to = "/index.xml"
status = 200
status = 301
[[redirects]]
from = "/rss"
to = "/index.xml"
status = 200
status = 301
# Moved Y2K site to its own subdomain:
[[redirects]]

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Make sure you run this script from the root of the site repository...
# Make sure you run this script from the root of the site repository.
echo "Pull latest Docker image..."
docker pull jakejarvis/hugo-custom:latest

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Make sure you run this script from the root of the site repository...
# Make sure you run this script from the root of the site repository.
echo "Pull latest base image..."
docker pull jakejarvis/hugo-custom:latest

View File

@ -1,6 +1,6 @@
#!/bin/bash
# only designed to run on Netlify's build image:
# only designed to run on Netlify's build image
# https://github.com/netlify/build-image
set -euo pipefail
@ -30,7 +30,7 @@ curl -sS -L https://github.com/imagemin/optipng-bin/raw/master/vendor/linux/x64/
chmod +x $BINDIR/optipng
# make sure everything's OK
echo "Is Hugo ready..?"
echo "Is Hugo ready?"
$BINDIR/hugo-extended version
# build Hugo site
@ -42,7 +42,7 @@ echo "Optimizing JPEGs..."
find ./public -iname "*.jp*" -print0 | xargs -0 $BINDIR/jpegoptim --max=80 --strip-all --quiet
echo "Optimizing PNGs..."
find ./public -iname "*.png" -print0 | xargs -0 $BINDIR/pngquant --quality=50-70 --speed 3 --ext=.png --force
find ./public -iname "*.png" -print0 | xargs -0 $BINDIR/optipng -o3 -force -strip all -quiet --
find ./public -iname "*.png" -print0 | xargs -0 $BINDIR/optipng -o1 -force -strip all -quiet --
# remove binaries (kinda unsafe, but doesn't really matter b/c it's docker)
echo "Cleaning up binaries..."