mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 16:48:26 -04:00
lock hugo to custom v0.53-DEV with docker
This commit is contained in:
parent
db9ded1ba0
commit
01141667a5
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@ -0,0 +1,6 @@
|
||||
# Repo will be added as a volume, so ignore everything...
|
||||
**
|
||||
|
||||
# ...except readme and license
|
||||
!/README.md
|
||||
!/LICENSE.md
|
29
.github/actions/hugo-build-action/Dockerfile
vendored
29
.github/actions/hugo-build-action/Dockerfile
vendored
@ -1,29 +0,0 @@
|
||||
FROM golang:1.12-alpine
|
||||
|
||||
LABEL repository="https://github.com/jakejarvis/hugo-build-action"
|
||||
LABEL homepage="https://jarv.is/"
|
||||
LABEL maintainer="Jake Jarvis <jake@jarv.is>"
|
||||
|
||||
ARG HUGO_BRANCH=noopener
|
||||
# ARG HUGO_COMMIT=a28865c
|
||||
ARG HUGO_BUILD_TAGS=extended
|
||||
|
||||
# CGO (and gcc/g++) required to build wellington/go-libsass
|
||||
ARG CGO=1
|
||||
ENV CGO_ENABLED=${CGO}
|
||||
ENV GOOS=linux
|
||||
ENV GO111MODULE=on
|
||||
|
||||
WORKDIR /go/src/github.com/gohugoio/hugo
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache git gcc g++ musl-dev && \
|
||||
git clone https://github.com/jakejarvis/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \
|
||||
if [ ! -z "$HUGO_BRANCH" ]; then git checkout $HUGO_BRANCH; fi && \
|
||||
if [ ! -z "$HUGO_COMMIT" ]; then git reset --hard $HUGO_COMMIT; fi && \
|
||||
go get github.com/magefile/mage && \
|
||||
mage hugo && mage install
|
||||
|
||||
RUN hugo version
|
||||
|
||||
ENTRYPOINT ["hugo"]
|
21
.github/actions/hugo-build-action/LICENSE.md
vendored
21
.github/actions/hugo-build-action/LICENSE.md
vendored
@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Jake Jarvis
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
23
.github/actions/hugo-build-action/README.md
vendored
23
.github/actions/hugo-build-action/README.md
vendored
@ -1,23 +0,0 @@
|
||||
# GitHub Action for [Hugo](https://github.com/gohugoio/hugo) ✏️
|
||||
|
||||
**⚠️ Warning:** This branch is specifically for testing the latest `dev` version built from the most recent commits to the [Hugo repository](https://github.com/gohugoio/hugo). For 99.9% of use cases, the stable [`master` branch](https://github.com/jakejarvis/hugo-build-action/tree/master) is more appropriate.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
### `workflow.yml` Example
|
||||
|
||||
```
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: jakejarvis/hugo-build-action@develop
|
||||
with:
|
||||
args: --minify --buildDrafts
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
This project is distributed under the [MIT license](LICENSE.md).
|
6
.github/workflows/gh-pages.yml
vendored
6
.github/workflows/gh-pages.yml
vendored
@ -13,8 +13,10 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
# pull from local Hugo action b/c LOTS of opinionated customizations
|
||||
- uses: ./.github/actions/hugo-build-action
|
||||
# pull from custom Hugo Extended image with opinionated changes
|
||||
# Docker hub: https://hub.docker.com/r/jakejarvis/hugo-jarv.is
|
||||
# base Dockerfile source: https://go.jarv.is/30KA6DS
|
||||
- uses: docker://jakejarvis/hugo-jarv.is:v0.53-DEV
|
||||
with:
|
||||
args: --gc --cleanDestinationDir
|
||||
- uses: jakejarvis/github-pages-deploy-action@master
|
||||
|
63
Dockerfile
Normal file
63
Dockerfile
Normal file
@ -0,0 +1,63 @@
|
||||
# Custom Hugo Extended fork, pre-built on Docker Hub:
|
||||
# https://hub.docker.com/r/jakejarvis/hugo-jarv.is
|
||||
# Source for base Dockerfile: https://go.jarv.is/30KA6DS
|
||||
#
|
||||
# Usage:
|
||||
# docker build -t jarv.is:develop -f Dockerfile .
|
||||
# docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
||||
# ...then open http://localhost:1313 for the live-refresh server.
|
||||
|
||||
FROM golang:1.12-alpine AS builder
|
||||
|
||||
ARG HUGO_REPO=https://github.com/jakejarvis/hugo.git
|
||||
# ARG HUGO_BRANCH=master
|
||||
# ARG HUGO_COMMIT=a28865c
|
||||
ARG HUGO_BUILD_TAGS=extended
|
||||
|
||||
# CGO (and gcc/g++) required to build wellington/go-libsass
|
||||
ARG CGO=1
|
||||
ENV CGO_ENABLED=${CGO}
|
||||
ENV GOOS=linux
|
||||
ENV GO111MODULE=on
|
||||
|
||||
RUN apk update && \
|
||||
apk add --no-cache git gcc g++ musl-dev && \
|
||||
git clone $HUGO_REPO $GOPATH/src/github.com/gohugoio/hugo && \
|
||||
cd $GOPATH/src/github.com/gohugoio/hugo && \
|
||||
if [ ! -z "$HUGO_BRANCH" ]; then git checkout $HUGO_BRANCH; fi && \
|
||||
if [ ! -z "$HUGO_COMMIT" ]; then git reset --hard $HUGO_COMMIT; fi && \
|
||||
go get github.com/magefile/mage && \
|
||||
mage hugo && mage install && \
|
||||
rm -rf $GOPATH/src
|
||||
|
||||
# verify we've built correctly
|
||||
RUN /go/bin/hugo version
|
||||
|
||||
# ---
|
||||
|
||||
FROM alpine:3.10
|
||||
|
||||
COPY --from=builder /go/bin/hugo /usr/bin/hugo
|
||||
|
||||
# install libc6-compat & libstdc++ since we're building extended Hugo
|
||||
# https://gitlab.com/yaegashi/hugo/commit/22f0d5cbd6114210ba7835468facbdee60609aa2
|
||||
# Twitter oEmbed shortcode fails without ca-certificates (x509: certificate signed by unknown authority)
|
||||
# https://github.com/google/go-github/issues/1049
|
||||
RUN apk update && \
|
||||
apk add --no-cache ca-certificates libc6-compat libstdc++ && \
|
||||
update-ca-certificates
|
||||
|
||||
# verify we've copied correctly
|
||||
RUN /usr/bin/hugo version
|
||||
|
||||
# add site source as volume
|
||||
VOLUME /src
|
||||
WORKDIR /src
|
||||
|
||||
# expose live-refresh server
|
||||
EXPOSE 1313
|
||||
|
||||
ENTRYPOINT ["/usr/bin/hugo"]
|
||||
|
||||
# remove before pushing to Docker Hub:
|
||||
CMD ["server", "--bind", "0.0.0.0", "--port", "1313"]
|
21
README.md
21
README.md
@ -11,10 +11,27 @@ Personal website of [@jakejarvis](https://github.com/jakejarvis), created and de
|
||||
|
||||
I keep an ongoing list of [blog post ideas](https://github.com/jakejarvis/jarv.is/issues/1) as an issue in this repo.
|
||||
|
||||
---
|
||||
|
||||
## Running a local testing server with Docker
|
||||
|
||||
This site runs a [custom version](https://github.com/jakejarvis/hugo) of [Hugo Extended](https://github.com/gohugoio/hugo) with a few (very opinionated) changes. To ensure consistency, the `Dockerfile` in this repository will pull my [pre-built](https://go.jarv.is/30KA6DS) Hugo fork (forked from `v0.53-DEV`, [gohugo/hugo@`a28865c`](https://github.com/gohugoio/hugo/tree/a28865cfc3e296cf0ddd0bd6c1368fcdb2154d0f)) and run a live testing server.
|
||||
|
||||
Run these commands on the root of this repository:
|
||||
|
||||
```bash
|
||||
docker build -t jarv.is:develop -f Dockerfile .
|
||||
docker run -v $(pwd):/src -p 1313:1313 jarv.is:develop
|
||||
```
|
||||
|
||||
...then open [http://localhost:1313/](http://localhost:1313/). Pages will live-refresh when source files are changed.
|
||||
|
||||
|
||||
## Licenses
|
||||
|
||||

|
||||
|
||||
Site content (everything in [`content/notes`](content/notes/)) is published under the [Creative Commons Attribution 4.0 International License](LICENSE.md) (CC-BY-4.0), which means that you can copy, redistribute, remix, transform, and build upon the content for any purpose as long as you give appropriate credit.
|
||||
|
||||
All code in this repository (such as my [Hugo theme](layouts/)) is published under the [MIT license](https://opensource.org/licenses/MIT). Everything else (such as the press articles and videos in [`misc`](misc/)) belongs to its respective owner(s) under the original license/copyright.
|
||||
All code in this repository (such as my [Hugo theme](layouts/)) is published under the [MIT license](https://opensource.org/licenses/MIT), except the customized Hugo fork which retains Hugo's [original Apache-2.0 license](https://github.com/gohugoio/hugo/blob/master/LICENSE).
|
||||
|
||||
Everything else (such as the press articles and videos in [`misc`](misc/)) belongs to its respective owner(s) under the original license/copyright.
|
||||
|
Loading…
x
Reference in New Issue
Block a user