diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a065dbf..3afa7a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 361b6c5..e460bea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ] \ No newline at end of file diff --git a/README.md b/README.md index 738214e..5b84aee 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ -# hugo \ No newline at end of file +# 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`