-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Version for Jekyll/Ruby build
- Loading branch information
0 parents
commit 56b39a2
Showing
4 changed files
with
104 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @dfuchss |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Docker Push Gitlab Runner 4 Jekyll | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 1 * *" | ||
workflow_dispatch: | ||
push: | ||
# Publish `v1.2.3` tags as releases. | ||
tags: | ||
- v* | ||
|
||
env: | ||
IMAGE_NAME: gitlab-runner-jekyll | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: mkdir build-dir && docker build build-dir --file gitlab-runner-jekyll/Dockerfile --tag $IMAGE_NAME | ||
|
||
- name: Log into registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
# Change all uppercase to lowercase | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
# Strip git ref prefix from version | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
# Strip "v" prefix from tag name | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
# Use Docker `latest` tag convention | ||
[ "$VERSION" == "main" ] && VERSION=latest | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION | ||
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# GitLab Runner for Ruby/Jekyll | ||
|
||
GitLab Runner for Shell usage + Ruby/Jekyll Support | ||
|
||
Instead of using `gitlab/gitlab-runner` simply use `ghcr.io/kit-sdq/gitlab-runner-jekyll` | ||
|
||
* Register as Runner in Shell Mode | ||
* ```docker run -d --name gitlab-runner-shell --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner ghcr.io/kit-sdq/gitlab-runner-jekyll``` | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
ARG RUBY_INSTALLER_VERSION=0.9.3 | ||
ARG RUBY_VERSION=3.2.2 | ||
|
||
FROM gitlab/gitlab-runner:latest | ||
|
||
RUN echo "Installing needed dependencies" \ | ||
&& apt-get update && apt-get install -y --no-install-recommends \ | ||
locales \ | ||
imagemagick \ | ||
build-essential \ | ||
zlib1g-dev \ | ||
jupyter-nbconvert \ | ||
npm \ | ||
python3-pip && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | ||
|
||
RUN echo "Fixing locales" \ | ||
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ | ||
&& locale-gen | ||
|
||
ENV LC_ALL=en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US.UTF-8 | ||
ENV JEKYLL_ENV=production | ||
|
||
ARG RUBY_INSTALLER_VERSION | ||
ARG RUBY_VERSION | ||
# https://github.com/postmodern/ruby-install/releases/download/v$RUBY_INSTALLER_VERSION/ruby-install-$RUBY_INSTALLER_VERSION.tar.gz | ||
RUN wget -O ruby-install.tar.gz "https://github.com/postmodern/ruby-install/releases/download/v${RUBY_INSTALLER_VERSION}/ruby-install-${RUBY_INSTALLER_VERSION}.tar.gz" && \ | ||
tar -xzf ruby-install.tar.gz && \ | ||
cd "ruby-install-${RUBY_INSTALLER_VERSION}/" && \ | ||
apt-get update && \ | ||
make install && \ | ||
ruby-install --system ruby "${RUBY_VERSION}" && \ | ||
cd .. && \ | ||
rm -rf ruby-install* && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* | ||
|
||
RUN pip3 install --upgrade jupyter | ||
RUN npm install -g purgecss |