Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f87f07f8f9 | ||
|
|
9ed686442d | ||
|
|
20e2344ae0 | ||
|
|
2991edd770 | ||
|
|
70cfc22566 | ||
|
|
00824687a7 | ||
|
|
746ef939c5 | ||
|
|
30ff3b9560 | ||
|
|
69daab6ad2 | ||
|
|
e60f5986bb | ||
|
|
29cbe17895 | ||
|
|
b4ba78cd21 | ||
|
|
d2d66f3d22 | ||
|
|
5995ad0f01 | ||
|
|
fb255ab34b | ||
|
|
7d14c7aedd | ||
|
|
a01a429a16 | ||
|
|
d19d7c4537 | ||
|
|
a096478374 | ||
|
|
58ee5ef39f | ||
|
|
c3ca3aee45 | ||
|
|
9e8f4c2c78 | ||
|
|
529d0654e6 | ||
|
|
5b64b6fad7 | ||
|
|
f0f4f7d8bc | ||
|
|
0015ccd295 | ||
|
|
a976891559 | ||
|
|
c210772313 | ||
|
|
ef0bc0645e | ||
|
|
91fb9c4fd6 | ||
|
|
5eb1ede626 | ||
|
|
6dbc298ab4 | ||
|
|
03aebc7810 | ||
|
|
20af46178d | ||
|
|
9181c228fd | ||
|
|
12b1b33f98 | ||
|
|
86edf34f33 | ||
|
|
0d7ab6ad6b | ||
|
|
7fc53eaa8c | ||
|
|
d51a7b1fdd | ||
|
|
c0ed88f355 | ||
|
|
aa150eb6b2 | ||
|
|
564b04aace | ||
|
|
f0b31cfa18 | ||
|
|
9e991ad064 | ||
|
|
7256a0acb5 | ||
|
|
f06920ae43 | ||
|
|
ae1dfe0585 | ||
|
|
30c4470861 | ||
|
|
57580c131b | ||
|
|
db197d1475 | ||
|
|
92c01bb28b | ||
|
|
fb4f85cf74 | ||
|
|
839e0e0397 | ||
|
|
b76d3b8a2a | ||
|
|
856296f324 | ||
|
|
e4a4891065 | ||
|
|
7981379307 | ||
|
|
8bb6f8fbdc | ||
|
|
389af18d80 | ||
|
|
18763f65a6 | ||
|
|
48446fa0eb | ||
|
|
808655bf8b | ||
|
|
7592c0e2c6 | ||
|
|
6090cb38f9 | ||
|
|
d74f9103bf | ||
|
|
b22391ffca | ||
|
|
e23a139a12 | ||
|
|
ff99e43a75 | ||
|
|
174aeb3258 | ||
|
|
05609758f3 | ||
|
|
a1dd5f842d | ||
|
|
1932e3375b | ||
|
|
74ecb5a404 | ||
|
|
14f96a18ff | ||
|
|
ee685078f0 | ||
|
|
d206b12c7e | ||
|
|
d25b2c40aa | ||
|
|
a6c246002d | ||
|
|
8a6b399cbf | ||
|
|
712198c4ae | ||
|
|
1c77e52852 | ||
|
|
3214ffcbd2 | ||
|
|
811526bd09 | ||
|
|
df4aafa18c | ||
|
|
06b9efcab8 | ||
|
|
8480c956b2 | ||
|
|
6137ccae83 | ||
|
|
661a1824d1 | ||
|
|
54d513c5c7 | ||
|
|
046e3288a9 | ||
|
|
8e534f1b4a | ||
|
|
b1dced691a | ||
|
|
c9946b6b31 | ||
|
|
ac17cca755 | ||
|
|
bb19030a73 | ||
|
|
6213d66bcd | ||
|
|
1d5a155cc2 | ||
|
|
a12ceeb0dd | ||
|
|
ca70d18293 | ||
|
|
06d8f4625d | ||
|
|
a1281ef45c | ||
|
|
9201778fad | ||
|
|
bff29ac494 | ||
|
|
e4be4ad005 | ||
|
|
10017089e9 | ||
|
|
fa1de4a811 | ||
|
|
e17bf4910b | ||
|
|
d72e997be8 | ||
|
|
76b0b01565 | ||
|
|
42929b8d14 | ||
|
|
594be32236 | ||
|
|
952fa6436d | ||
|
|
df396afc51 | ||
|
|
5ab9c36182 | ||
|
|
123a06f31f | ||
|
|
fa889767b2 | ||
|
|
04f0651b9f | ||
|
|
b7f8c8ffe7 | ||
|
|
bb7c15e231 | ||
|
|
bdfbe31f59 | ||
|
|
3e7ea713b6 | ||
|
|
731f9b4d35 | ||
|
|
6171bd339f | ||
|
|
8b2f017591 | ||
|
|
5396e6c1d7 | ||
|
|
403f37aa99 | ||
|
|
74563f9602 | ||
|
|
8f5f35b0c6 | ||
|
|
ad54eac81f | ||
|
|
86a40ab6f5 | ||
|
|
42aca0e18c | ||
|
|
844b04fea7 | ||
|
|
2af8cebe4d | ||
|
|
bf8100e41f | ||
|
|
bacc2b46e1 | ||
|
|
88bfb9c06c | ||
|
|
c25bf7c2ed | ||
|
|
18572ff629 | ||
|
|
65dce5c979 | ||
|
|
a8485e8339 | ||
|
|
93357a7d27 | ||
|
|
f15dd52add | ||
|
|
c998ea371d | ||
|
|
f6ad6ef8a2 | ||
|
|
e3231ab205 | ||
|
|
9c58db7a57 | ||
|
|
c03e9ebf66 | ||
|
|
11f175b8f9 | ||
|
|
b5291c758b | ||
|
|
059387c11c | ||
|
|
db30f47307 | ||
|
|
4e4cffbb08 | ||
|
|
a99dfa793e | ||
|
|
bdc848c9a0 | ||
|
|
26ed21bcfc | ||
|
|
5357aa869c | ||
|
|
d68d9f6fc8 | ||
|
|
abd5a962b5 | ||
|
|
7ccb4ed034 | ||
|
|
531dbeab92 | ||
|
|
814b400daf | ||
|
|
c569803c05 | ||
|
|
57fd528ae9 | ||
|
|
fad3705687 | ||
|
|
dbf917bdc9 | ||
|
|
15bc90d41e | ||
|
|
5f16e6caf2 | ||
|
|
c0b9c0300e | ||
|
|
4dc6700829 | ||
|
|
3e492d23bd | ||
|
|
d2f686e857 | ||
|
|
18198af872 | ||
|
|
03bd34f460 | ||
|
|
210dcf0f84 | ||
|
|
fd49993401 | ||
|
|
1e12527d1b | ||
|
|
7648aa4205 | ||
|
|
5c2992ba3f | ||
|
|
f0db7fd111 | ||
|
|
01aa45246c | ||
|
|
3d44159889 | ||
|
|
258480828a | ||
|
|
48ee0c82d4 | ||
|
|
a3b5dc873d | ||
|
|
632d9e59ad | ||
|
|
3ef0c00503 |
+35
-11
@@ -3,9 +3,13 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- Dockerfile.base
|
||||
- .github/workflows/base.yml
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
schedule:
|
||||
- cron: '0 22 * * *'
|
||||
|
||||
|
||||
jobs:
|
||||
ubuntu_base_latest_deploy:
|
||||
@@ -14,30 +18,35 @@ jobs:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.base -t ${ORG}/github-runner-base:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.base -t ${ORG}/github-runner-base:latest --output "type=image,push=true" --platform linux/amd64,linux/arm64 .
|
||||
ubuntu_base_bionic_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
@@ -45,24 +54,39 @@ jobs:
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.base.ubuntu-bionic -t ${ORG}/github-runner-base:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_base_xenial_deploy:
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.base.ubuntu-bionic -t ${ORG}/github-runner-base:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
|
||||
debian_base_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
release: [buster, bullseye, sid]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile.base Dockerfile.base.ubuntu-xenial; sed -i.bak 's/FROM.*/FROM ubuntu:xenial/' Dockerfile.base.ubuntu-xenial
|
||||
run: cp Dockerfile.base Dockerfile.base.debian-${{ matrix.release }}; sed -i.bak 's/FROM.*/FROM debian:${{ matrix.release }}/' Dockerfile.base.debian-${{ matrix.release }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.base.ubuntu-xenial -t ${ORG}/github-runner-base:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.base.debian-${{ matrix.release }} -t ${ORG}/github-runner-base:debian-${{ matrix.release }} --output "type=image,push=true" --platform linux/amd64,linux/arm64,linux/arm/v7 .
|
||||
|
||||
@@ -7,6 +7,8 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
schedule:
|
||||
- cron: '59 23 * * *'
|
||||
|
||||
jobs:
|
||||
ubuntu_latest_deploy:
|
||||
@@ -15,30 +17,35 @@ jobs:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile -t ${ORG}/github-runner:latest --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile -t ${ORG}/github-runner:latest --output "type=image,push=true" --platform linux/amd64,linux/arm64 .
|
||||
ubuntu_bionic_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
@@ -46,24 +53,39 @@ jobs:
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_xenial_deploy:
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
|
||||
debian_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
release: [buster, bullseye, sid]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile Dockerfile.ubuntu-xenial; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-xenial/" Dockerfile.ubuntu-xenial
|
||||
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.ubuntu-xenial -t ${ORG}/github-runner:ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.debian-${{ matrix.release }} -t ${ORG}/github-runner:debian-${{ matrix.release }} --output "type=image,push=true" --platform linux/amd64,linux/arm64,linux/arm/v7 .
|
||||
@@ -1,47 +1,67 @@
|
||||
name: GitHub Actions Runner in Docker - Release
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- Dockerfile.base
|
||||
- README.md
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
create-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
ubuntu_latest_tag:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-release
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
|
||||
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile -t ${ORG}/github-runner:${TAG} --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile -t ${ORG}/github-runner:${TAG} --output "type=image,push=true" --platform linux/amd64,linux/arm64 .
|
||||
ubuntu_bionic_tag:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-release
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
|
||||
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
@@ -49,26 +69,42 @@ jobs:
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:${TAG}-ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
ubuntu_xenial_tag:
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.ubuntu-bionic -t ${ORG}/github-runner:${TAG}-ubuntu-bionic --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
|
||||
debian_tag:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
release: [buster, bullseye, sid]
|
||||
fail-fast: false
|
||||
needs: create-release
|
||||
steps:
|
||||
- name: Copy Repo Files
|
||||
uses: actions/checkout@master
|
||||
- name: get version
|
||||
run: echo ::set-env name=TAG::${GITHUB_REF#refs/tags/}
|
||||
run: echo 'TAG='${GITHUB_REF#refs/tags/} >> $GITHUB_ENV
|
||||
- name: Get GitHub organization or user
|
||||
run: echo ::set-env name=ORG::$(dirname ${GITHUB_REPOSITORY})
|
||||
run: echo 'ORG='$(dirname ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: crazy-max/ghaction-docker-buildx@v1
|
||||
with:
|
||||
version: latest
|
||||
buildx-version: latest
|
||||
- name: Available platforms
|
||||
run: echo ${{ steps.buildx.outputs.platforms }}
|
||||
- name: Copy Dockerfile
|
||||
run: cp Dockerfile Dockerfile.ubuntu-xenial; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:ubuntu-xenial/" Dockerfile.ubuntu-xenial
|
||||
run: cp Dockerfile Dockerfile.debian-${{ matrix.release }}; sed -i.bak "s/FROM.*/FROM ${ORG}\/github-runner-base:debian-${{ matrix.release }}/" Dockerfile.debian-${{ matrix.release }}
|
||||
- name: Login
|
||||
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build
|
||||
run: docker buildx build -f Dockerfile.ubuntu-xenial -t ${ORG}/github-runner:${TAG}-ubuntu-xenial --output "type=image,push=true" --platform linux/amd64,linux/arm/v7,linux/arm64 .
|
||||
uses: nick-invision/retry@v2
|
||||
with:
|
||||
max_attempts: 3
|
||||
retry_on: error
|
||||
timeout_minutes: 120
|
||||
command: docker buildx build -f Dockerfile.debian-${{ matrix.release }} -t ${ORG}/github-runner:${TAG}-debian-${{ matrix.release }} --output "type=image,push=true" --platform linux/amd64,linux/arm64,linux/arm/v7 .
|
||||
|
||||
@@ -3,6 +3,7 @@ repos:
|
||||
rev: 1.0.2
|
||||
hooks:
|
||||
- id: shell-lint
|
||||
args: [-e, SC1008]
|
||||
- repo: https://github.com/stratasan/hadolint-pre-commit
|
||||
rev: cdefcb096e520a6daa9552b1d4636f5f1e1729cd
|
||||
hooks:
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
shellcheck 0.7.0
|
||||
@@ -0,0 +1,3 @@
|
||||
6/3/2021 (latest)
|
||||
|
||||
* `ORG_RUNNER` is now deprecated in favor of `RUNNER_SCOPE`. If you are currently using `ORG_RUNNER` please drop that in favor of `RUNNER_SCOPE="org"`
|
||||
+8
-3
@@ -2,7 +2,10 @@
|
||||
FROM myoung34/github-runner-base:latest
|
||||
LABEL maintainer="myoung34@my.apsu.edu"
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.262.0"
|
||||
ENV AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
|
||||
RUN mkdir -p /opt/hostedtoolcache
|
||||
|
||||
ARG GH_RUNNER_VERSION="2.280.2"
|
||||
ARG TARGETPLATFORM
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
@@ -14,6 +17,8 @@ RUN chmod +x /actions-runner/install_actions.sh \
|
||||
&& /actions-runner/install_actions.sh ${GH_RUNNER_VERSION} ${TARGETPLATFORM} \
|
||||
&& rm /actions-runner/install_actions.sh
|
||||
|
||||
COPY entrypoint.sh /
|
||||
RUN chmod +x /entrypoint.sh
|
||||
COPY token.sh entrypoint.sh /
|
||||
RUN chmod +x /token.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["/actions-runner/bin/runsvc.sh"]
|
||||
|
||||
+36
-14
@@ -1,28 +1,52 @@
|
||||
FROM ubuntu:eoan
|
||||
FROM ubuntu:focal
|
||||
LABEL maintainer="myoung34@my.apsu.edu"
|
||||
|
||||
ARG GIT_VERSION="2.26.2"
|
||||
# TODO: Ubuntu focal (20.04) has git v2.25, but the minimum needed for GitHub
|
||||
# Actions runners is v2.29. For now, we build git from source. When updating
|
||||
# to hirsute (21.04) or later, we can remove the instructions to build from
|
||||
# source in favor of the regular Ubuntu git package.
|
||||
ARG GIT_VERSION="2.29.0"
|
||||
|
||||
ARG DUMB_INIT_VERSION="1.2.2"
|
||||
ARG DOCKER_KEY="7EA0A9C3F273FCD8"
|
||||
|
||||
ENV DOCKER_COMPOSE_VERSION="1.27.4"
|
||||
ENV LANG=en_US.UTF-8
|
||||
ENV LANGUAGE=en_US:en
|
||||
ENV LC_ALL=en_US.UTF-8
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
# hadolint ignore=DL3003
|
||||
# hadolint ignore=DL3003,DL4001
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
awscli \
|
||||
curl \
|
||||
tar \
|
||||
unzip \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
sudo \
|
||||
gnupg-agent \
|
||||
gpg-agent \
|
||||
gnupg \
|
||||
software-properties-common \
|
||||
build-essential \
|
||||
zlib1g-dev \
|
||||
zstd \
|
||||
gettext \
|
||||
liblttng-ust0 \
|
||||
libcurl4-openssl-dev \
|
||||
inetutils-ping \
|
||||
jq \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
wget \
|
||||
dirmngr \
|
||||
openssh-client \
|
||||
locales \
|
||||
python3-pip \
|
||||
python \
|
||||
dumb-init \
|
||||
&& pip3 install --no-cache-dir awscliv2 \
|
||||
&& locale-gen en_US.UTF-8 \
|
||||
&& dpkg-reconfigure locales \
|
||||
&& c_rehash \
|
||||
&& cd /tmp \
|
||||
&& curl -sL https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz -o git.tgz \
|
||||
@@ -32,13 +56,11 @@ RUN apt-get update && \
|
||||
&& 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 - \
|
||||
&& [[ $(lsb_release -cs) == "eoan" ]] && ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu disco stable" ) || ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" )\
|
||||
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ${DOCKER_KEY} \
|
||||
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | awk '{print tolower($0)}')/gpg | apt-key add - \
|
||||
&& ( add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(lsb_release -is | awk '{print tolower($0)}') $(lsb_release -cs) stable" ) \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -sL "https://github.com/docker/compose/releases/download/1.25.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
|
||||
&& chmod +x /usr/local/bin/docker-compose
|
||||
&& apt-get install -y docker-ce docker-ce-cli containerd.io --no-install-recommends --allow-unauthenticated \
|
||||
&& [[ $(lscpu -J | jq -r '.lscpu[] | select(.field == "Vendor ID:") | .data') == "ARM" ]] && echo "Not installing docker-compose. See https://github.com/docker/compose/issues/6831" || ( curl -sL "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose ) \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
@@ -1,18 +1,58 @@
|
||||
Docker Github Actions Runner
|
||||
============================
|
||||
|
||||
[](https://hub.docker.com/r/myoung34/github-runner)
|
||||
[](https://hub.docker.com/r/myoung34/github-runner) [](https://github.com/jonico/awesome-runners)
|
||||
|
||||
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).
|
||||
|
||||
This has been tested and verified on:
|
||||
## Notes ##
|
||||
|
||||
* x86_64
|
||||
* armhf
|
||||
* armv7
|
||||
* arm64
|
||||
|
||||
**NOTE: Only one runner can use the same RUNNER_WORKDIR if it is shared storage.**
|
||||
### Docker Support ###
|
||||
|
||||
Please note that while this runner installs and allows docker, github actions itself does not support using docker from a self hosted runner yet.
|
||||
For more information:
|
||||
|
||||
* https://github.com/actions/runner/issues/406
|
||||
* https://github.com/actions/runner/issues/367
|
||||
|
||||
Also, some GitHub Actions Workflow features, like [Job Services](https://docs.github.com/en/actions/guides/about-service-containers), won't be usable and [will result in an error](https://github.com/myoung34/docker-github-actions-runner/issues/61).
|
||||
|
||||
### Docker-Compose on ARM ###
|
||||
|
||||
Please note `docker-compose` does not currently work on ARM ([see issue](https://github.com/docker/compose/issues/6831)) so it is not installed on ARM based builds here.
|
||||
A workaround exists, please see [here](https://github.com/myoung34/docker-github-actions-runner/issues/72#issuecomment-804723656)
|
||||
|
||||
## Docker Artifacts ##
|
||||
|
||||
| Container Base | Supported Architectures | Tag Regex | Docker Tags | Description | Notes |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| ubuntu focal | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+/` | [latest](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=latest) | This is the latest build (Rebuilt nightly and on master merges). Tags without an OS name are included. | Tags without an OS name *before* 9/17/2020 are `eoan`. `armv7` support stopped 9/18/2020 due to inconsistent docker-ce packaging |
|
||||
| ubuntu bionic | `x86_64`,`armv7`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-bionic/` | [ubuntu-bionic](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-bionic) | This is the latest build from bionic (Rebuilt nightly and on master merges). Tags with `-ubuntu-bionic` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
|
||||
| debian buster | `x86_64`,`arm64`,`armv7` | `/\d\.\d{3}\.\d+-debian-buster/` | [debian-buster](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-buster) | This is the latest build from buster (Rebuilt nightly and on master merges). Tags with `-debian-buster` are included and created on [upstream tags](https://github.com/actions/runner/tags). | |
|
||||
| debian bullseye | `x86_64`,`arm64`,`armv7` | `/\d\.\d{3}\.\d+-debian-bullseye/` | [debian-bullseye](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-bullseye) | This is the latest build from bullseye (Rebuilt nightly and on master merges). Tags with `-debian-bullseye` are included and created on [upstream tags](https://github.com/actions/runner/tags). | Debian Bullseye will be the next stable release of Debian Linux. |
|
||||
| debian sid | `x86_64`,`arm64`,`admv7` | `/\d\.\d{3}\.\d+-debian-sid/` | [debian-sid](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=debian-sid) | This is the latest build from sid (Rebuilt nightly and on master merges). Tags with `-debian-sid` are included and created on [upstream tags](https://github.com/actions/runner/tags). | Debian sid is considered unstable by Debian. |
|
||||
| ubuntu xenial | `x86_64`,`arm64` | `/\d\.\d{3}\.\d+-ubuntu-xenial/` | [ubuntu-xenial](https://hub.docker.com/r/myoung34/github-runner/tags?page=1&name=ubuntu-xenial) | This is the latest build from xenial (Rebuilt nightly and on master merges). Tags with `-ubuntu-xenial` are included and created on [upstream tags](https://github.com/actions/runner/tags). | This is deprecated as of 7/15/2021 and will no longer receive tags. |
|
||||
|
||||
These containers are built via Github actions that [copy the dockerfile](https://github.com/myoung34/docker-github-actions-runner/blob/master/.github/workflows/deploy.yml#L47), changing the `FROM` and building to provide simplicity.
|
||||
|
||||
## Environment Variables ##
|
||||
|
||||
| Environment Variable | Description |
|
||||
| --- | --- |
|
||||
| `RUNNER_NAME` | The name of the runner to use. Supercedes (overrides) `RUNNER_NAME_PREFIX` |
|
||||
| `RUNNER_NAME_PREFIX` | A prefix for a randomly generated name (followed by a random 13 digit string). You must not also provide `RUNNER_NAME`. Defaults to `github-runner` |
|
||||
| `ACCESS_TOKEN` | A [github PAT](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to use to generate `RUNNER_TOKEN` dynamically at container start. Not using this requires a valid `RUNNER_TOKEN` |
|
||||
| `RUNNER_SCOPE` | The scope the runner will be registered on. Valid values are `repo`, `org` and `ent`. For 'org' and 'enterprise', `ACCESS_TOKEN` is required and `REPO_URL` is unneccesary. If 'org', requires `ORG_NAME`; if 'enterprise', requires `ENTERPRISE_NAME`. Default is 'repo'. |
|
||||
| `ORG_NAME` | The organization name for the runner to register under. Requires `RUNNER_SCOPE` to be 'org'. No default value. |
|
||||
| `ENTERPRISE_NAME` | The enterprise name for the runner to register under. Requires `RUNNER_SCOPE` to be 'enterprise'. No default value. |
|
||||
| `LABELS` | A comma separated string to indicate the labels. Default is 'default' |
|
||||
| `REPO_URL` | If using a non-organization runner this is the full repository url to register under such as 'https://github.com/myoung34/repo' |
|
||||
| `RUNNER_TOKEN` | If not using a PAT for `ACCESS_TOKEN` this will be the runner token provided by the Add Runner UI (a manual process). Note: This token is short lived and will change frequently. `ACCESS_TOKEN` is likely preferred. |
|
||||
| `RUNNER_WORKDIR` | The working directory for the runner. Runners on the same host should not share this directory. Default is '/_work'. This must match the source path for the bind-mounted volume at RUNNER_WORKDIR, in order for container actions to access files. |
|
||||
| `RUNNER_GROUP` | Name of the runner group to add this runner to (defaults to the default runner group) |
|
||||
| `GITHUB_HOST` | Optional URL of the Github Enterprise server e.g github.mycompany.com. Defaults to `github.com`. |
|
||||
| `DISABLE_AUTOMATIC_DEREGISTRATION` | Optional flag to disable signal catching for deregistration. Default is `false`. Any value other than exactly `false` is considered `true`. See [here](https://github.com/myoung34/docker-github-actions-runner/issues/94) |
|
||||
| `CONFIGURED_ACTIONS_RUNNER_FILES_DIR` | Path to use for runner data. It allows avoiding reregistration each the start of the runner. No default value. |
|
||||
|
||||
## Examples ##
|
||||
|
||||
@@ -22,14 +62,14 @@ If you're using a RHEL based OS with SELinux, add `--security-opt=label=disable`
|
||||
|
||||
### Manual ###
|
||||
|
||||
```
|
||||
# org runner
|
||||
```shell
|
||||
# org runner
|
||||
docker run -d --restart always --name github-runner \
|
||||
-e REPO_URL="https://github.com/myoung34/repo" \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_TOKEN="footoken" \
|
||||
-e RUNNER_NAME_PREFIX="myrunner" \
|
||||
-e ACCESS_TOKEN="footoken" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
|
||||
-e ORG_RUNNER="true" \
|
||||
-e RUNNER_GROUP="my-group" \
|
||||
-e RUNNER_SCOPE="org" \
|
||||
-e ORG_NAME="octokode" \
|
||||
-e LABELS="my-label,other-label" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
@@ -41,14 +81,32 @@ docker run -d --restart always --name github-runner \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_TOKEN="footoken" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
|
||||
-e RUNNER_GROUP="my-group" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
|
||||
myoung34/github-runner:latest
|
||||
```
|
||||
|
||||
Or shell wrapper:
|
||||
Adding the reusage of the registered runner (can be propogated to all other approaches):
|
||||
|
||||
```shell
|
||||
# per repo
|
||||
docker run -d --restart always --name github-runner \
|
||||
-e REPO_URL="https://github.com/myoung34/repo" \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_TOKEN="footoken" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
|
||||
-e RUNNER_GROUP="my-group" \
|
||||
-e CONFIGURED_ACTIONS_RUNNER_FILES_DIR="/actions-runner-files" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
|
||||
-v /tmp/foo:/actions-runner-files \
|
||||
myoung34/github-runner:latest
|
||||
```
|
||||
|
||||
Shell wrapper:
|
||||
|
||||
```shell
|
||||
function github-runner {
|
||||
name=github-runner-${1//\//-}
|
||||
org=$(dirname $1)
|
||||
@@ -60,33 +118,32 @@ function github-runner {
|
||||
-e RUNNER_TOKEN="$2" \
|
||||
-e RUNNER_NAME="linux-${repo}" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner-${repo}" \
|
||||
-e ORG_RUNNER="true" \
|
||||
-e ORG_NAME="octokode" \
|
||||
-e RUNNER_GROUP="my-group" \
|
||||
-e LABELS="my-label,other-label" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-${repo}:/tmp/github-runner-${repo} \
|
||||
--name $name ${org}/github-runner:${tag}
|
||||
--name $name myoung34/github-runner:latest
|
||||
}
|
||||
|
||||
github-runner your-account/your-repo AARGHTHISISYOURGHACTIONSTOKEN
|
||||
github-runner your-account/some-other-repo ARGHANOTHERGITHUBACTIONSTOKEN ubuntu-xenial
|
||||
github-runner your-account/some-other-repo ARGHANOTHERGITHUBACTIONSTOKEN ubuntu-focal
|
||||
```
|
||||
|
||||
Or `docker-compose.yml`:
|
||||
|
||||
```yml
|
||||
version: '2.3'
|
||||
|
||||
services:
|
||||
worker:
|
||||
build: .
|
||||
image: myoung34/github-runner:latest
|
||||
environment:
|
||||
REPO_URL: https://github.com/example/repo
|
||||
RUNNER_NAME: example-name
|
||||
RUNNER_TOKEN: someGithubTokenHere
|
||||
RUNNER_WORKDIR: /tmp/runner/work
|
||||
ORG_RUNNER: true
|
||||
ORG_NAME: example-github-org
|
||||
RUNNER_GROUP: my-group
|
||||
RUNNER_SCOPE: 'repo'
|
||||
LABELS: linux,x64,gpu
|
||||
security_opt:
|
||||
# needed on SELinux systems to allow docker container to manage other docker containers
|
||||
@@ -94,14 +151,14 @@ services:
|
||||
volumes:
|
||||
- '/var/run/docker.sock:/var/run/docker.sock'
|
||||
- '/tmp/runner:/tmp/runner'
|
||||
# note: a quirk of docker-in-docker is that this path
|
||||
# note: a quirk of docker-in-docker is that this path
|
||||
# needs to be the same path on host and inside the container,
|
||||
# docker mgmt cmds run outside of docker but expect the paths from within
|
||||
```
|
||||
|
||||
### Nomad ###
|
||||
|
||||
```
|
||||
```hcl
|
||||
job "github_runner" {
|
||||
datacenters = ["home"]
|
||||
type = "system"
|
||||
@@ -110,17 +167,21 @@ job "github_runner" {
|
||||
driver = "docker"
|
||||
|
||||
env {
|
||||
REPO_URL = "https://github.com/your-account/your-repo"
|
||||
RUNNER_TOKEN = "footoken"
|
||||
RUNNER_WORKDIR = "/tmp/github-runner-your-repo"
|
||||
ORG_RUNNER = "true"
|
||||
ORG_NAME = "octokode"
|
||||
LABELS = "my-label,other-label"
|
||||
ACCESS_TOKEN = "footoken"
|
||||
RUNNER_NAME_PREFIX = "myrunner"
|
||||
RUNNER_WORKDIR = "/tmp/github-runner-your-repo"
|
||||
RUNNER_GROUP = "my-group"
|
||||
RUNNER_SCOPE = "org"
|
||||
ORG_NAME = "octokode"
|
||||
LABELS = "my-label,other-label"
|
||||
}
|
||||
|
||||
config {
|
||||
privileged = true
|
||||
image = "myoung34/github-runner:latest"
|
||||
|
||||
privileged = true
|
||||
userns_mode = "host"
|
||||
|
||||
volumes = [
|
||||
"/var/run/docker.sock:/var/run/docker.sock",
|
||||
"/tmp/github-runner-your-repo:/tmp/github-runner-your-repo",
|
||||
@@ -132,7 +193,7 @@ job "github_runner" {
|
||||
|
||||
### Kubernetes ###
|
||||
|
||||
```
|
||||
```yml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -159,8 +220,10 @@ spec:
|
||||
- name: runner
|
||||
image: myoung34/github-runner:latest
|
||||
env:
|
||||
- name: ORG_RUNNER
|
||||
value: true
|
||||
- name: ACCESS_TOKEN
|
||||
value: foo-access-token
|
||||
- name: RUNNER_SCOPE
|
||||
value: "org"
|
||||
- name: ORG_NAME
|
||||
value: octokode
|
||||
- name: LABELS
|
||||
@@ -169,12 +232,16 @@ spec:
|
||||
value: footoken
|
||||
- name: REPO_URL
|
||||
value: https://github.com/your-account/your-repo
|
||||
- name: RUNNER_NAME_PREFIX
|
||||
value: foo
|
||||
- name: RUNNER_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: RUNNER_WORKDIR
|
||||
value: /tmp/github-runner-your-repo
|
||||
- name: RUNNER_GROUP
|
||||
value: my-group
|
||||
volumeMounts:
|
||||
- name: dockersock
|
||||
mountPath: /var/run/docker.sock
|
||||
@@ -184,7 +251,7 @@ spec:
|
||||
|
||||
## Usage From GH Actions Workflow ##
|
||||
|
||||
```
|
||||
```yml
|
||||
name: Package
|
||||
|
||||
on:
|
||||
@@ -204,16 +271,47 @@ jobs:
|
||||
|
||||
A runner token can be automatically acquired at runtime if `ACCESS_TOKEN` (a GitHub personal access token) is a supplied. This uses the [GitHub Actions API](https://developer.github.com/v3/actions/self_hosted_runners/#create-a-registration-token). e.g.:
|
||||
|
||||
```
|
||||
```shell
|
||||
docker run -d --restart always --name github-runner \
|
||||
-e ACCESS_TOKEN="footoken" \
|
||||
-e REPO_URL="https://github.com/myoung34/repo" \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
|
||||
-e ORG_RUNNER="true" \
|
||||
-e RUNNER_GROUP="my-group" \
|
||||
-e RUNNER_SCOPE="org" \
|
||||
-e ORG_NAME="octokode" \
|
||||
-e LABELS="my-label,other-label" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
|
||||
myoung34/github-runner:latest
|
||||
```
|
||||
|
||||
## Create GitHub personal access token ##
|
||||
|
||||
Creating GitHub personal access token (PAT) for using by self-hosted runner make sure the following scopes are selected:
|
||||
|
||||
* repo (all)
|
||||
* admin:org (all) **_(mandatory for organization-wide runner)_**
|
||||
* admin:enterprise (all) **_(mandatory for enterprise-wide runner)_**
|
||||
* admin:public_key - read:public_key
|
||||
* admin:repo_hook - read:repo_hook
|
||||
* admin:org_hook
|
||||
* notifications
|
||||
* workflow
|
||||
|
||||
Also, when creating a PAT for self-hosted runner which will process events from several repositories of the particular organization, create the PAT using organization owner account. Otherwise your new PAT will not have sufficient privileges for all repositories.
|
||||
|
||||
## Run a runner on enterprise scope ##
|
||||
|
||||
```shell
|
||||
docker run -d --restart always --name github-runner \
|
||||
-e ACCESS_TOKEN="footoken" \
|
||||
-e RUNNER_NAME="foo-runner" \
|
||||
-e RUNNER_WORKDIR="/tmp/github-runner-your-repo" \
|
||||
-e RUNNER_GROUP="my-group" \
|
||||
-e RUNNER_SCOPE="enterprise" \
|
||||
-e ENTERPRISE_NAME="my-enterprise" \
|
||||
-e LABELS="my-label,other-label" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /tmp/github-runner-your-repo:/tmp/github-runner-your-repo \
|
||||
myoung34/github-runner:latest
|
||||
```
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
## Security
|
||||
|
||||
If you believe you have found a security vulnerability, please report it to me as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.** Instead, please report them to me directly at [myoung34@my.apsu.edu](mailto:myoung34@my.apsu.edu).
|
||||
|
||||
If you'd like to communicate securely, my keybase is [here](https://keybase.io/3vilpenguin)
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
I prefer all communications to be in English.
|
||||
+97
-39
@@ -1,50 +1,108 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/dumb-init /bin/bash
|
||||
|
||||
export RUNNER_ALLOW_RUNASROOT=1
|
||||
export PATH=$PATH:/actions-runner
|
||||
|
||||
_RUNNER_NAME=${RUNNER_NAME:-default}
|
||||
deregister_runner() {
|
||||
echo "Caught SIGTERM. Deregistering runner"
|
||||
_TOKEN=$(bash /token.sh)
|
||||
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
|
||||
./config.sh remove --token "${RUNNER_TOKEN}"
|
||||
exit
|
||||
}
|
||||
|
||||
_DISABLE_AUTOMATIC_DEREGISTRATION=${DISABLE_AUTOMATIC_DEREGISTRATION:-false}
|
||||
|
||||
_RUNNER_NAME=${RUNNER_NAME:-${RUNNER_NAME_PREFIX:-github-runner}-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 13 ; echo '')}
|
||||
_RUNNER_WORKDIR=${RUNNER_WORKDIR:-/_work}
|
||||
_ORG_RUNNER=${ORG_RUNNER:-false}
|
||||
_LABELS=${LABELS:-default}
|
||||
_SHORT_URL=${REPO_URL}
|
||||
_RUNNER_GROUP=${RUNNER_GROUP:-Default}
|
||||
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
|
||||
|
||||
if [[ -n "${ACCESS_TOKEN}" ]]; then
|
||||
URI=https://api.github.com
|
||||
API_VERSION=v3
|
||||
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
||||
AUTH_HEADER="Authorization: token ${ACCESS_TOKEN}"
|
||||
|
||||
_PROTO="$(echo "${REPO_URL}" | grep :// | sed -e's,^\(.*://\).*,\1,g')"
|
||||
# shellcheck disable=SC2116
|
||||
_URL="$(echo "${REPO_URL/${_PROTO}/}")"
|
||||
_PATH="$(echo "${_URL}" | grep / | cut -d/ -f2-)"
|
||||
_ACCOUNT="$(echo "${_PATH}" | cut -d/ -f1)"
|
||||
_REPO="$(echo "${_PATH}" | cut -d/ -f2)"
|
||||
|
||||
_FULL_URI="${URI}/repos/${_ACCOUNT}/${_REPO}/actions/runners/registration-token"
|
||||
if [[ ${_ORG_RUNNER} == "true" ]]; then
|
||||
[[ -z ${ORG_NAME} ]] && ( echo "ORG_NAME required for org runners"; exit 1 )
|
||||
_FULL_URI="${URI}/orgs/${ORG_NAME}/actions/runners/registration-token"
|
||||
_SHORT_URL="${_PROTO}github.com/${ORG_NAME}"
|
||||
fi
|
||||
echo curl -XPOST -fsSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${_FULL_URI}"
|
||||
RUNNER_TOKEN="$(curl -XPOST -fsSL \
|
||||
-H "${AUTH_HEADER}" \
|
||||
-H "${API_HEADER}" \
|
||||
"${_FULL_URI}" \
|
||||
| jq -r '.token')"
|
||||
# ensure backwards compatibility
|
||||
if [[ -z $RUNNER_SCOPE ]]; then
|
||||
if [[ ${ORG_RUNNER} == "true" ]]; then
|
||||
echo 'ORG_RUNNER is now deprecated. Please use RUNNER_SCOPE="org" instead.'
|
||||
export RUNNER_SCOPE="org"
|
||||
else
|
||||
export RUNNER_SCOPE="repo"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Configuring"
|
||||
RUNNER_SCOPE="${RUNNER_SCOPE,,}" # to lowercase
|
||||
|
||||
./config.sh \
|
||||
--url "${_SHORT_URL}" \
|
||||
--token "${RUNNER_TOKEN}" \
|
||||
--name "${_RUNNER_NAME}" \
|
||||
--work "${_RUNNER_WORKDIR}" \
|
||||
--labels "${_LABELS}" \
|
||||
--unattended \
|
||||
--replace
|
||||
case ${RUNNER_SCOPE} in
|
||||
org*)
|
||||
[[ -z ${ORG_NAME} ]] && ( echo "ORG_NAME required for org runners"; exit 1 )
|
||||
_SHORT_URL="https://${_GITHUB_HOST}/${ORG_NAME}"
|
||||
RUNNER_SCOPE="org"
|
||||
;;
|
||||
|
||||
./bin/runsvc.sh
|
||||
ent*)
|
||||
[[ -z ${ENTERPRISE_NAME} ]] && ( echo "ENTERPRISE_NAME required for enterprise runners"; exit 1 )
|
||||
_SHORT_URL="https://${_GITHUB_HOST}/enterprises/${ENTERPRISE_NAME}"
|
||||
RUNNER_SCOPE="enterprise"
|
||||
;;
|
||||
|
||||
*)
|
||||
[[ -z ${REPO_URL} ]] && ( echo "REPO_URL required for repo runners"; exit 1 )
|
||||
_SHORT_URL=${REPO_URL}
|
||||
RUNNER_SCOPE="repo"
|
||||
;;
|
||||
esac
|
||||
|
||||
configure_runner() {
|
||||
if [[ -n "${ACCESS_TOKEN}" ]]; then
|
||||
echo "Obtaining the token of the runnet"
|
||||
_TOKEN=$(bash /token.sh)
|
||||
RUNNER_TOKEN=$(echo "${_TOKEN}" | jq -r .token)
|
||||
fi
|
||||
|
||||
echo "Configuring"
|
||||
./config.sh \
|
||||
--url "${_SHORT_URL}" \
|
||||
--token "${RUNNER_TOKEN}" \
|
||||
--name "${_RUNNER_NAME}" \
|
||||
--work "${_RUNNER_WORKDIR}" \
|
||||
--labels "${_LABELS}" \
|
||||
--runnergroup "${_RUNNER_GROUP}" \
|
||||
--unattended \
|
||||
--replace
|
||||
}
|
||||
|
||||
|
||||
# Opt into runner reusage because a value was given
|
||||
if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
|
||||
echo "Runner reusage is enabled"
|
||||
|
||||
# directory exists, copy the data
|
||||
if [[ -d "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
|
||||
echo "Copying previous data"
|
||||
cp -p -r "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}/." "/actions-runner"
|
||||
fi
|
||||
|
||||
if [ -f "/actions-runner/.runner" ]; then
|
||||
echo "The runner has already been configured"
|
||||
else
|
||||
configure_runner
|
||||
fi
|
||||
else
|
||||
echo "Runner reusage is disabled"
|
||||
configure_runner
|
||||
fi
|
||||
|
||||
if [[ -n "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}" ]]; then
|
||||
echo "Reusage is enabled. Storing data to ${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
|
||||
# Quoting (even with double-quotes) the regexp brokes the copying
|
||||
cp -p -r "/actions-runner/_diag" "/actions-runner/svc.sh" /actions-runner/.[^.]* "${CONFIGURED_ACTIONS_RUNNER_FILES_DIR}"
|
||||
fi
|
||||
|
||||
if [[ ${_DISABLE_AUTOMATIC_DEREGISTRATION} == "false" ]]; then
|
||||
trap deregister_runner SIGINT SIGQUIT SIGTERM
|
||||
fi
|
||||
|
||||
unset ACCESS_TOKEN
|
||||
unset RUNNER_TOKEN
|
||||
|
||||
# Container's command (CMD) execution
|
||||
"$@"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash -x
|
||||
#!/bin/bash -ex
|
||||
GH_RUNNER_VERSION=$1
|
||||
TARGETPLATFORM=$2
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
_GITHUB_HOST=${GITHUB_HOST:="github.com"}
|
||||
|
||||
# If URL is not github.com then use the enterprise api endpoint
|
||||
if [[ ${GITHUB_HOST} = "github.com" ]]; then
|
||||
URI="https://api.${_GITHUB_HOST}"
|
||||
else
|
||||
URI="https://${_GITHUB_HOST}/api/v3"
|
||||
fi
|
||||
|
||||
API_VERSION=v3
|
||||
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
||||
AUTH_HEADER="Authorization: token ${ACCESS_TOKEN}"
|
||||
|
||||
case ${RUNNER_SCOPE} in
|
||||
org*)
|
||||
_FULL_URL="${URI}/orgs/${ORG_NAME}/actions/runners/registration-token"
|
||||
;;
|
||||
|
||||
ent*)
|
||||
_FULL_URL="${URI}/enterprises/${ENTERPRISE_NAME}/actions/runners/registration-token"
|
||||
;;
|
||||
|
||||
*)
|
||||
_PROTO="https://"
|
||||
# shellcheck disable=SC2116
|
||||
_URL="$(echo "${REPO_URL/${_PROTO}/}")"
|
||||
_PATH="$(echo "${_URL}" | grep / | cut -d/ -f2-)"
|
||||
_ACCOUNT="$(echo "${_PATH}" | cut -d/ -f1)"
|
||||
_REPO="$(echo "${_PATH}" | cut -d/ -f2)"
|
||||
_FULL_URL="${URI}/repos/${_ACCOUNT}/${_REPO}/actions/runners/registration-token"
|
||||
;;
|
||||
esac
|
||||
|
||||
RUNNER_TOKEN="$(curl -XPOST -fsSL \
|
||||
-H "${AUTH_HEADER}" \
|
||||
-H "${API_HEADER}" \
|
||||
"${_FULL_URL}" \
|
||||
| jq -r '.token')"
|
||||
|
||||
echo "{\"token\": \"${RUNNER_TOKEN}\", \"full_url\": \"${_FULL_URL}\"}"
|
||||
Reference in New Issue
Block a user