diff --git a/.github/workflows/build.yml b/.forgejo/workflows/build.yml similarity index 76% rename from .github/workflows/build.yml rename to .forgejo/workflows/build.yml index 042907f..8d9325e 100644 --- a/.github/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -7,13 +7,12 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: debian-bookworm - strategy: - matrix: - hugo-version: ["0.126.3"] - node-version: ["22"] - go-version: ["1.22.3"] + strategy: + matrix: + hugo-version: ["0.127.0", "0.126.0"] + node-version: ["22"] steps: - uses: actions/checkout@v3 @@ -50,5 +49,5 @@ jobs: NODE_VERSION=${{ matrix.node-version }} GO_VERSION=${{ matrix.go-version }} tags: | - git.myco.systems/mycosystems/hugo-ci:extended-${{ matrix.hugo-version }}-${{ matrix.node-version }}-${{ matrix.go-version }} - git.myco.systems/mycosystems/hugo-ci:extended-latest + git.myco.systems/mycosystems/hugo-ci:extended-alpine-${{ matrix.hugo-version }}-${{ matrix.node-version }}-${{ matrix.go-version }} + git.myco.systems/mycosystems/hugo-ci:extended-alpine-latest diff --git a/Dockerfile b/Dockerfile index dad14a0..4f153b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,58 @@ -ARG GO_VERSION="1.22.3" -FROM golang:${GO_VERSION}-bullseye +FROM alpine:3.20 as build +ARG HUGO_VERSION="0.127.0" +ARG NODE_VERSION="22.2.0" -ARG HUGO_VERSION="0.126.3" -ARG NODE_VERSION="22" +RUN apk add --update --no-cache xz libssl3 ca-certificates openssl-dev curl ninja pkgconf icu-dev git linux-headers libc6-compat make g++ gcc ada-dev brotli-dev c-ares-dev nghttp2-dev python3 samurai zlib-dev py3-pip libuv-dev -RUN apt update -y -RUN apt install tar gzip build-essential ca-certificates curl gnupg -y -RUN mkdir -p /etc/apt/keyrings -RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list -RUN apt update -y && apt-get install -y nodejs -RUN npm i -g yarn pnpm -RUN mkdir /tmp/temph +WORKDIR /tmp + +RUN curl -sL -o hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz && \ + tar -xf "hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" && \ + cp ./hugo /usr/bin/hugo && \ + hugo version + +RUN curl -sL -o node-v${NODE_VERSION}.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.xz" && \ + tar -xf "node-v${NODE_VERSION}.tar.xz" && \ + cd node-v22.2.0 && \ + ./configure --prefix=/usr \ + --shared-brotli \ + --shared-zlib \ + --shared-libuv \ + --shared-openssl \ + --shared-cares \ + --shared-nghttp2 \ + --ninja \ + --without-npm \ + --with-intl=system-icu \ + --openssl-use-def-ca-store && \ + make BUILDTYPE=Release && \ + make install + +FROM alpine:3.20 + +RUN apk add --update --no-cache \ + brotli \ + zlib \ + libuv \ + openssl \ + c-ares \ + nghttp2 \ + icu \ + ca-certificates \ + libgcc \ + libstdc++ \ + libc6-compat \ + linux-headers \ + rsync \ + openssh \ + npm \ + && rm -rf /var/cache/apk/* + +COPY --from=build /usr/bin/hugo /usr/bin/hugo +COPY --from=build /usr/bin/node /usr/bin/node +COPY --from=build /usr/lib/node_modules /usr/lib/node_modules +COPY --from=build /usr/include/node /usr/include/node 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 mv ./hugo /usr/bin/hugo WORKDIR /home/app -# Cleanup -RUN rm -rfv /tmp/temph -ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file +ENTRYPOINT [ "/bin/sh" ] \ No newline at end of file diff --git a/README.md b/README.md index fb46cc0..3072b20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Hugo Extended CI Container -Contains NodeJS, yarn, pnpm, npm +Based on golang:`go version`-alpine + +Contains nodejs, hugo, npm, rsync Specific tag versions follow this definition: extended-`hugo version`-`node vesion`-`go vesion` @@ -10,7 +12,7 @@ eg. git.myco.systems/mycosystems/hugo-ci:extended-0.126.3-22-1.22.3 ``` -# To use +## To use Run the following in your hugo directory: ``` @@ -21,8 +23,10 @@ To also host locally: docker run -p 1313:1313 -v .:/home/app -ti --network=host git.myco.systems/mycosystems/hugo-ci:extended-latest ``` -# Links +## Links -~~[Docker](https://hub.docker.com/r/betterweb/hugo)~~ -~~[Github](https://github.com/BetterCorp/hugo)~~ -[MycoSystems Packages](https://git.myco.systems/mycosystems/-/packages/container/hugo-ci/versions) \ No newline at end of file +- ~~[BetterWeb Docker](https://hub.docker.com/r/betterweb/hugo)~~ + +- ~~[BeterCorp Github](https://github.com/BetterCorp/hugo)~~ + +- [MycoSystems Packages](https://git.myco.systems/mycosystems/-/packages/container/hugo-ci/versions) \ No newline at end of file