-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All users to install Go into the action container.
- Loading branch information
1 parent
891f91f
commit cba355d
Showing
5 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
FROM debian:buster-slim | ||
LABEL maintainer="Ben Selby <[email protected]>" | ||
|
||
## | ||
# Define the location of Go. | ||
# We may not always install it, but if we do, it's here. | ||
## | ||
ENV GOPATH /go | ||
ENV PATH /go/bin:/usr/local/go/bin:$PATH | ||
|
||
## | ||
# Installation of all the tooling we need. | ||
## | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
|
@@ -9,6 +19,12 @@ RUN apt-get update && \ | |
git && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
## | ||
# Copy over the action script. | ||
## | ||
COPY action.sh /usr/bin/action.sh | ||
|
||
## | ||
# Run the action. | ||
## | ||
ENTRYPOINT ["action.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ | |
set -e | ||
set -o pipefail | ||
|
||
### | ||
# Environment variable definitions. | ||
## | ||
if [[ -n "${TOKEN}" ]]; then | ||
GITHUB_TOKEN=${TOKEN} | ||
fi | ||
|
@@ -35,11 +38,42 @@ else | |
EXTENDED_URL="" | ||
fi | ||
|
||
### | ||
# Downloading of Hugo. | ||
### | ||
echo "Downloading Hugo: ${HUGO_VERSION}${EXTENDED_INFO}" | ||
URL=https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${EXTENDED_URL}${HUGO_VERSION}_Linux-64bit.deb | ||
echo "Using '${URL}' to download Hugo" | ||
curl -sSL "${URL}" > /tmp/hugo.deb && dpkg --force architecture -i /tmp/hugo.deb | ||
|
||
|
||
### | ||
# Optionally install Go. | ||
### | ||
# shellcheck disable=SC2153 | ||
if [[ -n "${GO_VERSION}" ]]; then | ||
echo "Installing Go: ${GO_VERSION}" | ||
|
||
curl -sL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" > /tmp/go.tar.gz | ||
tar -C /tmp -xf /tmp/go.tar.gz | ||
mv /tmp/go /go | ||
rm -rf \ | ||
/usr/local/go/pkg/*/cmd \ | ||
/usr/local/go/pkg/bootstrap \ | ||
/usr/local/go/pkg/obj \ | ||
/usr/local/go/pkg/tool/*/api \ | ||
/usr/local/go/pkg/tool/*/go_bootstrap \ | ||
/usr/local/go/src/cmd/dist/dist \ | ||
/tmp/go.tag.gz | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
muratcanakcay
|
||
|
||
# Provide version details and sanity check installation | ||
echo "Installed Go: ${GO_VERSION}" | ||
go version | ||
fi | ||
|
||
### | ||
# Build the site. | ||
### | ||
echo "Building the Hugo site with: 'hugo ${HUGO_ARGS}'" | ||
hugo "${HUGO_ARGS}" | ||
|
||
|
@@ -68,7 +102,9 @@ fi | |
echo "Getting hash for base repository commit" | ||
HASH=$(echo "${GITHUB_SHA}" | cut -c1-7) | ||
|
||
### | ||
# Now add all the changes and commit and push | ||
### | ||
if [[ "${TARGET_BRANCH}" != "master" ]]; then | ||
git checkout -b ${TARGET_BRANCH} | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I guess there's a typo here. Shouldn't it be
/tmp/go.tar.gz
instead of/tmp/go.tag.gz
?