chore(build.yml): update matrix for hugo-version, node-version, and go-version

chore(build.yml): update build-args and tags for docker build
chore(Dockerfile): add NODE_VERSION argument and update wget and tar commands
chore(README.md): update README with information about the latest docker container and usage instructions
This commit is contained in:
mrinc 2023-07-25 11:51:07 +02:00
parent 7000a6099a
commit 64e3b38876
3 changed files with 79 additions and 7 deletions

View file

@ -11,7 +11,21 @@ jobs:
strategy:
matrix:
hugo-version: ["0.115.4"]
hugo-version:
[
"0.112.6",
"0.112.7",
"0.113.0",
"0.114.0",
"0.114.1",
"0.115.0",
"0.115.1",
"0.115.2",
"0.115.3",
"0.115.4",
]
node-version: ["16", "18"]
go-version: ["1", "1.19", "1.19.11", "1.20", "1.20.5", "1.20.6"]
steps:
- uses: actions/checkout@v3
@ -40,5 +54,48 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64 # ,linux/arm64/v8
push: true
build-args: HUGO_VERSION=${{ matrix.hugo-version }}
tags: betterweb/hugo:${{ matrix.hugo-version }}-extended
build-args: |
HUGO_VERSION=${{ matrix.hugo-version }}
NODE_VERSION=${{ matrix.node-version }}
GO_VERSION=${{ matrix.go-version }}
tags: |
betterweb/hugo:${{ matrix.hugo-version }}-${{ matrix.node-vesion }}-${{ matrix.go-vesion }}
betterweb/hugo:${{ matrix.hugo-version }}-${{ matrix.node-vesion }}-${{ matrix.go-vesion }}-extended
build-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: linux/amd64 # ,linux/arm64/v8
push: true
build-args: |
HUGO_VERSION=0.115.4
NODE_VERSION=18
GO_VERSION=1.20
tags: |
betterweb/hugo:latest
betterweb/hugo:latest-extended

View file

@ -1,4 +1,5 @@
ARG HUGO_VERSION=0.115.4
ARG NODE_VERSION=18
FROM golang:1.20.6-bullseye
@ -9,10 +10,11 @@ RUN npm i -g yarn pnpm
RUN mkdir /tmp/temph
RUN mkdir /home/app
WORKDIR /tmp/temph
RUN wget https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_$HUGO_VERSION_Linux-64bit.tar.gz
RUN tar xf ./hugo_extended_$HUGO_VERSION_Linux-64bit.tar.gz
RUN wget "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz"
RUN tar xf "hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz"
RUN mv ./hugo /usr/bin/hugo
WORKDIR /home/app
# Cleanup
RUN rm -rfv /tmp/temph
ENTRYPOINT [ "/bin/bash" ]

View file

@ -1 +1,14 @@
# hugo
# hugo extended
Contains NodeJS, yarn, pnpm, npm
latest docker container contains:
Specific tag versions follow this definition:
`hugo version`-`node vesion`-`go vesion`
# To use
Run the following in your hugo directory: `docker run -v .:/home/app -ti --network=host betterweb/hugo:latest`
To also host locally: `docker run -p 8080:8080 -v .:/home/app -ti --network=host betterweb/hugo:latest`