mirror of
https://github.com/jakejarvis/hugo-docker.git
synced 2025-04-29 12:10:29 -04:00
Compare commits
51 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
40ca2c3269 | ||
![]() |
9733fc0fa6 | ||
![]() |
f4114734b1 | ||
![]() |
fee04015be | ||
![]() |
f824746b8c | ||
![]() |
f9610724d5 | ||
![]() |
fdd2072620 | ||
![]() |
165a3ca3f7 | ||
![]() |
a2b583f385 | ||
![]() |
33c0ae7566 | ||
![]() |
061c644f39 | ||
![]() |
748017bd04 | ||
![]() |
9474a6a64d | ||
![]() |
4d5ec5f93f | ||
![]() |
49de69b30e | ||
![]() |
1d30ce8bcb | ||
![]() |
b2ab6f0041 | ||
![]() |
3758f9cad1 | ||
![]() |
7f24c16703 | ||
![]() |
c8d6cbb13a | ||
![]() |
16b4f6cdd4 | ||
![]() |
06258ba98b | ||
![]() |
846307e4c8 | ||
![]() |
974cf9f787 | ||
![]() |
5169e3ddfa | ||
![]() |
65507b8300 | ||
![]() |
4a14b72e5b | ||
![]() |
8305e01188 | ||
![]() |
81a93ea44d | ||
![]() |
d4dab75ac4 | ||
![]() |
c8c26d1fb7 | ||
![]() |
ff4c4d46af | ||
e2ba706deb | |||
59a94508dc | |||
421a334f8c | |||
21d629e15c | |||
391c858bed | |||
ba3a3969b7 | |||
af6f3b8139 | |||
669722c47a | |||
e98baa7dc4 | |||
755a524c55 | |||
![]() |
18e51db24a | ||
![]() |
ebe3e97c81 | ||
![]() |
22e644d81d | ||
![]() |
4d1191ce2b | ||
9b9a34e059 | |||
![]() |
3d5a32a41a | ||
bdfadabde1 | |||
ad2b89ae8e | |||
ad10482235 |
96
.github/workflows/build.yml
vendored
96
.github/workflows/build.yml
vendored
@ -4,79 +4,89 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
tags:
|
pull_request:
|
||||||
- 'v*'
|
branches:
|
||||||
|
- master
|
||||||
|
merge_group:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
|
||||||
|
env:
|
||||||
|
HUB_IMAGE: jakejarvis/hugo-extended
|
||||||
|
GHCR_IMAGE: ghcr.io/jakejarvis/hugo-extended
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||||
|
with:
|
||||||
- name: Prepare tags
|
fetch-depth: 0
|
||||||
id: tag
|
|
||||||
env:
|
|
||||||
HUB_IMAGE: jakejarvis/hugo-extended
|
|
||||||
GHCR_IMAGE: ghcr.io/jakejarvis/hugo-extended
|
|
||||||
run: |
|
|
||||||
TAGS="${HUB_IMAGE}:latest,${GHCR_IMAGE}:latest"
|
|
||||||
|
|
||||||
# If triggered by a new tag, add a version tag to the image
|
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/v}
|
|
||||||
TAGS="$TAGS,${HUB_IMAGE}:${VERSION},${GHCR_IMAGE}:${VERSION}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set output parameters
|
|
||||||
echo ::set-output name=tags::${TAGS}
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: jakejarvis
|
||||||
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GHCR_PAT }}
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Cache Docker layers
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: /tmp/.buildx-cache
|
path: /tmp/.buildx-cache
|
||||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-buildx-
|
${{ runner.os }}-buildx-
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Parse Hugo version
|
||||||
if: github.event_name != 'pull_request'
|
id: parse_version
|
||||||
uses: docker/login-action@v2
|
run: |
|
||||||
with:
|
HUGO_VERSION="$(grep -oP '(?<=^ARG HUGO_VERSION=).+$' Dockerfile)"
|
||||||
username: jakejarvis
|
echo "HUGO_VERSION=$HUGO_VERSION" >> $GITHUB_OUTPUT
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.GHCR_PAT }}
|
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
id: build
|
id: build
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: ./
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: ${{ github.ref == 'refs/heads/master' }}
|
||||||
tags: ${{ steps.tag.outputs.tags }}
|
tags: "${{ env.HUB_IMAGE }}:latest,${{ env.GHCR_IMAGE }}:latest,${{ env.HUB_IMAGE }}:${{ steps.parse_version.outputs.HUGO_VERSION }},${{ env.GHCR_IMAGE }}:${{ steps.parse_version.outputs.HUGO_VERSION }}"
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||||
|
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
run: echo ${{ steps.build.outputs.digest }}
|
run: echo ${{ steps.build.outputs.digest }}
|
||||||
|
|
||||||
|
- name: Update hub description
|
||||||
|
uses: peter-evans/dockerhub-description@v4
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
with:
|
||||||
|
username: jakejarvis
|
||||||
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
|
repository: ${{ env.HUB_IMAGE }}
|
||||||
|
short-description: "✏️ Hugo Extended for x64 and ARM64 with PostCSS, Babel, Pandoc, and more baked in."
|
||||||
|
readme-filepath: ./README.md
|
||||||
|
enable-url-completion: true
|
||||||
|
19
Dockerfile
19
Dockerfile
@ -1,15 +1,14 @@
|
|||||||
# the following version can be overridden at image build time with --build-arg
|
# the following version can be overridden at image build time with --build-arg
|
||||||
ARG HUGO_VERSION=0.111.0
|
# renovate: datasource=github-releases depName=gohugoio/hugo
|
||||||
|
ARG HUGO_VERSION=0.124.1
|
||||||
|
|
||||||
# remove/comment the following line completely to compile vanilla Hugo:
|
# remove/comment the following line completely to compile vanilla Hugo:
|
||||||
ARG HUGO_BUILD_TAGS=extended
|
ARG HUGO_BUILD_TAGS=extended
|
||||||
|
|
||||||
# Hugo >= v0.81.0 requires Go 1.16+ to build
|
|
||||||
ARG GO_VERSION=1.19
|
|
||||||
ARG ALPINE_VERSION=3.17
|
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build
|
# Hugo >= v0.81.0 requires Go 1.16+ to build
|
||||||
|
FROM golang:1.22-alpine3.18 AS build
|
||||||
|
|
||||||
# renew global args from above
|
# renew global args from above
|
||||||
# https://docs.docker.com/engine/reference/builder/#scope
|
# https://docs.docker.com/engine/reference/builder/#scope
|
||||||
@ -48,14 +47,16 @@ RUN go install github.com/yaegashi/muslstack@latest && \
|
|||||||
|
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
FROM alpine:${ALPINE_VERSION}
|
FROM alpine:3.18
|
||||||
|
|
||||||
# renew global args from above & pin any dependency versions
|
# renew global args from above & pin any dependency versions
|
||||||
ARG HUGO_VERSION
|
ARG HUGO_VERSION
|
||||||
# https://github.com/jgm/pandoc/releases
|
# https://github.com/jgm/pandoc/releases
|
||||||
ARG PANDOC_VERSION=2.19.2
|
# renovate: datasource=github-releases depName=jgm/pandoc
|
||||||
|
ARG PANDOC_VERSION=3.1.13
|
||||||
# https://github.com/sass/dart-sass-embedded/releases
|
# https://github.com/sass/dart-sass-embedded/releases
|
||||||
ARG DART_SASS_VERSION=1.58.3
|
# renovate: datasource=github-releases depName=sass/dart-sass-embedded
|
||||||
|
ARG DART_SASS_VERSION=1.62.1
|
||||||
|
|
||||||
LABEL version="${HUGO_VERSION}"
|
LABEL version="${HUGO_VERSION}"
|
||||||
LABEL repository="https://github.com/jakejarvis/hugo-docker"
|
LABEL repository="https://github.com/jakejarvis/hugo-docker"
|
||||||
|
27
renovate.json
Normal file
27
renovate.json
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:base"
|
||||||
|
],
|
||||||
|
"automerge": true,
|
||||||
|
"platformAutomerge": true,
|
||||||
|
"regexManagers": [
|
||||||
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"^Dockerfile$"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?( registryUrl=(?<registryUrl>.*?))?\\s.*?_VERSION=(?<currentValue>.*)\\s"
|
||||||
|
],
|
||||||
|
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchFiles": [
|
||||||
|
"^Dockerfile$"
|
||||||
|
],
|
||||||
|
"extractVersion": "^v(?<version>.*)$"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user