2019-07-27 19:29:29 +09:00
|
|
|
FROM golang:1.12.7-buster
|
2019-05-22 05:57:34 +09:00
|
|
|
|
2019-07-27 19:29:29 +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"
|
|
|
|
|
|
2019-08-30 19:49:35 +02:00
|
|
|
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 && \
|
2019-07-30 19:43:01 +09:00
|
|
|
mv ./hugo /go/bin/
|
2019-05-22 05:57:34 +09:00
|
|
|
|
2019-07-27 19:29:29 +09:00
|
|
|
ENTRYPOINT [ "/go/bin/hugo" ]
|