actions-hugo/Dockerfile

35 lines
1.2 KiB
Text
Raw Normal View History

FROM golang:1.12.7-buster
2019-05-22 05:57:34 +09:00
LABEL "com.github.actions.name"="Hugo action"
LABEL "com.github.actions.description"="GitHub Actions for Hugo extended and Hugo Modules"
2019-05-22 05:57:34 +09:00
LABEL "com.github.actions.icon"="package"
LABEL "com.github.actions.color"="yellow"
LABEL "repository"="https://github.com/peaceiris/actions-hugo"
LABEL "homepage"="https://github.com/peaceiris/actions-hugo"
LABEL "maintainer"="peaceiris"
ARG HUGO_VERSION="auto"
RUN echo "Hugo version: ${HUGO_VERSION}"
RUN if [ "$HUGO_VERSION" = "auto" ]; then \
echo "Using automated version detection" && \
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | \
grep browser_download_url | \
cut -d '"' -f 4 | \
grep -e 'hugo_extended_.*_Linux.*\.tar\.gz' | \
xargs curl -fsSL -O; fi
RUN if [ ! "$HUGO_VERSION" = "auto" ]; then \
echo "Using fixed version $HUGO_VERSION" && \
curl "https://api.github.com/repos/gohugoio/hugo/releases/tags/v${HUGO_VERSION}" | \
grep browser_download_url | \
cut -d '"' -f 4 | \
grep -e 'hugo_extended_.*_Linux.*\.tar\.gz' | \
xargs curl -fsSL -O; fi
RUN cat *.gz | tar -xzvf - -i && \
mv ./hugo /go/bin/
2019-05-22 05:57:34 +09:00
ENTRYPOINT [ "/go/bin/hugo" ]