diff --git a/.woodpecker.yml b/.woodpecker.yml deleted file mode 100644 index 7dbaed8..0000000 --- a/.woodpecker.yml +++ /dev/null @@ -1,13 +0,0 @@ -pipeline: - build-and-push: - image: plugins/docker - settings: - registry: code.cozy.town - username: - from_secret: registry_username - password: - from_secret: registry_token - repo: code.cozy.town/vrifox/hugoci - tags: - - latest - cache_from: code.cozy.town/vrifox/hugoci:latest \ No newline at end of file diff --git a/.woodpecker/.build-image.yaml b/.woodpecker/.build-image.yaml new file mode 100644 index 0000000..0820cab --- /dev/null +++ b/.woodpecker/.build-image.yaml @@ -0,0 +1,31 @@ +variables: + - &HUGO_VERSION=0.115.3 + +steps: + build-and-push: + image: woodpeckerci/plugin-docker-buildx + settings: + registry: code.cozy.town + username: + from_secret: registry_username + password: + from_secret: registry_token + repo: code.cozy.town/vrifox/hugoci + tags: + - latest + - ${HUGO_VERSION} + cache_from: code.cozy.town/vrifox/hugoci:latest + build_args: + - HUGO_VERSION: ${HUGO_VERSION} + when: + branch: [ main ] + + build-and-push-test: + image: woodpeckerci/plugin-docker-buildx + settings: + dry-run: true + build_args: + - HUGO_VERSION: ${HUGO_VERSION} + when: + branch: + exclude: [ main ] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5c82374..91f2f53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,9 @@ FROM docker.io/alpine:latest -RUN apk add --no-cache hugo git openssh rsync \ No newline at end of file +ARG HUGO_VERSION +RUN apk add --no-cache wget tar git openssh rsync + +RUN wget https://github.com/gohugoio/hugo/releases/latest/download/hugo_extended_${HUGO_VERSION}_linux_amd64.tar.gz +RUN tar -xf hugo_extended_${HUGO_VERSION}_linux_amd64.tar.gz +RUN ls -lah +RUN chmod +x hugo_extended_${HUGO_VERSION}_linux_amd64 +RUN mv hugo_extended_${HUGO_VERSION}_linux_amd64 /usr/local/bin/hugo \ No newline at end of file