Compare commits

...
9 Commits
9 changed files with 372 additions and 38 deletions
+58 -17
View File
@@ -6,28 +6,69 @@ on:
- develop
jobs:
build:
ubuntu_latest_deploy_x86:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Publish Docker Image to GPR
uses: myoung34/gpr-docker-publish@master
id: docker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
IMAGE_NAME: 'runner'
DOCKERFILE_PATH: 'Dockerfile'
BUILD_CONTEXT: '.'
build_hub:
- name: Build
run: docker build -f Dockerfile.ubuntu -t myoung34/github-runner:latest .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:latest
ubuntu_bionic_deploy_x86:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Publish to Hub Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: myoung34/github-runner
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build
run: docker build -f Dockerfile.ubuntu-bionic -t myoung34/github-runner:ubuntu-bionic .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:ubuntu-bionic
ubuntu_xenial_deploy_x86:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Build
run: docker build -f Dockerfile.ubuntu-xenial -t myoung34/github-runner:ubuntu-xenial .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:ubuntu-xenial
ubuntu_latest_deploy_arm:
runs-on: self-hosted
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Build
run: docker build -f Dockerfile.ubuntu-arm -t myoung34/github-runner:latest-arm .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:latest-arm
ubuntu_bionic_deploy_arm:
runs-on: self-hosted
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Build
run: docker build -f Dockerfile.ubuntu-bionic-arm -t myoung34/github-runner:ubuntu-bionic-arm .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:ubuntu-bionic-arm
ubuntu_xenial_deploy_arm:
runs-on: self-hosted
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Build
run: docker build -f Dockerfile.ubuntu-xenial-arm -t myoung34/github-runner:ubuntu-xenial-arm .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:ubuntu-xenial-arm
+69 -19
View File
@@ -5,31 +5,81 @@ on:
- '*'
jobs:
build:
ubuntu_tag_deploy_x86:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo "::set-env name=IMAGE_TAG::$(cat Dockerfile | grep ARG\ GH_RUNNER_VERSION | sed 's/.*="\(.*\)"/\1/g')"
- name: Publish Docker Image to GPR
uses: myoung34/gpr-docker-publish@master
id: docker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
IMAGE_NAME: 'runner'
DOCKERFILE_PATH: 'Dockerfile'
BUILD_CONTEXT: '.'
build_hub:
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
- name: Build
run: docker build -f Dockerfile.ubuntu -t myoung34/github-runner:${TAG} .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:${TAG}
ubuntu_bionic_deploy_x86:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: Publish to Hub Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: myoung34/github-runner
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
tag_names: true
- name: get version
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
- name: Build
run: docker build -f Dockerfile.ubuntu-bionic -t myoung34/github-runner:${TAG}-ubuntu-bionic .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:${TAG}-ubuntu-bionic
ubuntu_xenial_deploy_x86:
runs-on: ubuntu-latest
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
- name: Build
run: docker build -f Dockerfile.ubuntu-xenial -t myoung34/github-runner:${TAG}-ubuntu-xenial .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:${TAG}-ubuntu-xenial
ubuntu_tag_deploy_arm:
runs-on: self-hosted
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
- name: Build
run: docker build -f Dockerfile.ubuntu-arm -t myoung34/github-runner:${TAG}-arm .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:${TAG}-arm
ubuntu_bionic_deploy_arm:
runs-on: self-hosted
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
- name: Build
run: docker build -f Dockerfile.ubuntu-bionic-arm -t myoung34/github-runner:${TAG}-ubuntu-bionic-arm .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:${TAG}-ubuntu-bionic-arm
ubuntu_xenial_deploy_arm:
runs-on: self-hosted
steps:
- name: Copy Repo Files
uses: actions/checkout@master
- name: get version
run: echo "::set-env name=TAG::$(echo ${GITHUB_REF} | sed -e "s/refs\/tags\///g")"
- name: Build
run: docker build -f Dockerfile.ubuntu-xenial-arm -t myoung34/github-runner:${TAG}-ubuntu-xenial-arm .
- name: Login
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
- name: Push to hub registry
run: docker push myoung34/github-runner:${TAG}-ubuntu-xenial-arm
+3 -2
View File
@@ -1,7 +1,7 @@
FROM ubuntu:xenial-20191024
FROM ubuntu:bionic
LABEL maintainer="3vilpenguin@gmail.com"
ARG GH_RUNNER_VERSION="2.160.2"
ARG GH_RUNNER_VERSION="2.162.0"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
@@ -13,6 +13,7 @@ RUN apt-get update && \
sudo \
gnupg-agent \
software-properties-common \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
+52
View File
@@ -0,0 +1,52 @@
FROM ubuntu:bionic
LABEL maintainer="3vilpenguin@gmail.com"
ARG GH_RUNNER_VERSION="2.162.0"
ARG GIT_VERSION="2.23.0"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tar \
apt-transport-https \
ca-certificates \
sudo \
gnupg-agent \
software-properties-common \
build-essential \
zlib1g-dev \
gettext \
liblttng-ust-ctl4 \
liblttng-ust0 \
liburcu6 \
libcurl4-openssl-dev \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/* \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
&& tar zxf git.tgz \
&& cd git-${GIT_VERSION} \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker.io --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /actions-runner
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& mkdir /_work
WORKDIR /_work
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+35
View File
@@ -0,0 +1,35 @@
FROM ubuntu:bionic
LABEL maintainer="3vilpenguin@gmail.com"
ARG GH_RUNNER_VERSION="2.162.0"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tar \
apt-transport-https \
ca-certificates \
sudo \
gnupg-agent \
software-properties-common \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /actions-runner
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& ./bin/installdependencies.sh \
&& mkdir /_work
WORKDIR /_work
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+52
View File
@@ -0,0 +1,52 @@
FROM ubuntu:bionic
LABEL maintainer="3vilpenguin@gmail.com"
ARG GH_RUNNER_VERSION="2.162.0"
ARG GIT_VERSION="2.23.0"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tar \
apt-transport-https \
ca-certificates \
sudo \
gnupg-agent \
software-properties-common \
build-essential \
zlib1g-dev \
gettext \
liblttng-ust-ctl4 \
liblttng-ust0 \
liburcu6 \
libcurl4-openssl-dev \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/* \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
&& tar zxf git.tgz \
&& cd git-${GIT_VERSION} \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker.io --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /actions-runner
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& mkdir /_work
WORKDIR /_work
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+35
View File
@@ -0,0 +1,35 @@
FROM ubuntu:xenial
LABEL maintainer="3vilpenguin@gmail.com"
ARG GH_RUNNER_VERSION="2.162.0"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tar \
apt-transport-https \
ca-certificates \
sudo \
gnupg-agent \
software-properties-common \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /actions-runner
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-x64-${GH_RUNNER_VERSION}.tar.gz \
&& ./bin/installdependencies.sh \
&& mkdir /_work
WORKDIR /_work
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+52
View File
@@ -0,0 +1,52 @@
FROM ubuntu:xenial
LABEL maintainer="3vilpenguin@gmail.com"
ARG GH_RUNNER_VERSION="2.162.0"
ARG GIT_VERSION="2.23.0"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
tar \
apt-transport-https \
ca-certificates \
sudo \
gnupg-agent \
software-properties-common \
build-essential \
zlib1g-dev \
gettext \
liblttng-ust-ctl2 \
liblttng-ust0 \
liburcu4 \
libcurl4-openssl-dev \
inetutils-ping \
&& rm -rf /var/lib/apt/lists/* \
&& cd /tmp \
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
&& tar zxf git.tgz \
&& cd git-${GIT_VERSION} \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& cd / \
&& rm -rf /tmp/git.tgz /tmp/git-${GIT_VERSION}
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
&& add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker.io --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /actions-runner
RUN curl -O https://githubassets.azureedge.net/runners/${GH_RUNNER_VERSION}/actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& tar -zxf actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& rm -f actions-runner-linux-arm-${GH_RUNNER_VERSION}.tar.gz \
&& mkdir /_work
WORKDIR /_work
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+16
View File
@@ -3,10 +3,17 @@ Docker Github Actions Runner
This will run the [new self-hosted github actions runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/hosting-your-own-runners) with docker-in-docker
This has been tested and verified on:
* x86_64
* armhf
## Examples ##
Manual:
### X86_64 ###
```
docker run -it \
-e REPO_URL="https://github.com/myoung34/LEDSpicer" \
@@ -14,6 +21,15 @@ docker run -it \
myoung34/github-runner:latest
```
### ARMHF (raspberry pi) ###
```
docker run -it \
-e REPO_URL="https://github.com/myoung34/LEDSpicer" \
-e RUNNER_TOKEN="footoken" \
myoung34/github-runner:latest-arm
```
Nomad:
```