mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:30:59 +00:00
80 lines
2.8 KiB
YAML
80 lines
2.8 KiB
YAML
on:
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
paths:
|
|
- 'runner/**'
|
|
- .github/workflows/build-runner.yml
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- runner/patched/*
|
|
- runner/Dockerfile
|
|
- runner/dindrunner.Dockerfile
|
|
- runner/entrypoint.sh
|
|
- .github/workflows/build-runner.yml
|
|
name: Runner
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Build
|
|
env:
|
|
RUNNER_VERSION: 2.273.5
|
|
DOCKER_VERSION: 19.03.12
|
|
DOCKERHUB_USERNAME: ${{ github.repository_owner }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
with:
|
|
buildx-version: latest
|
|
|
|
- name: Build Container Image
|
|
working-directory: runner
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
run: |
|
|
docker buildx build \
|
|
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
|
|
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner:v${RUNNER_VERSION} \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner:latest \
|
|
-f Dockerfile .
|
|
docker buildx build \
|
|
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
|
|
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner-dind:v${RUNNER_VERSION} \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner-dind:latest \
|
|
-f dindrunner.Dockerfile .
|
|
|
|
- name: Login to GitHub Docker Registry
|
|
run: echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
|
|
if: ${{ github.event_name == 'push' }}
|
|
env:
|
|
DOCKERHUB_USERNAME: ${{ github.repository_owner }}
|
|
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
|
|
|
- name: Build and Push Container Image
|
|
working-directory: runner
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: |
|
|
docker buildx build \
|
|
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
|
|
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner:v${RUNNER_VERSION} \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner:latest \
|
|
-f Dockerfile . --push
|
|
docker buildx build \
|
|
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
|
|
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
|
|
--platform linux/amd64,linux/arm64 \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner-dind:v${RUNNER_VERSION} \
|
|
--tag ${DOCKERHUB_USERNAME}/actions-runner-dind:latest \
|
|
-f dindrunner.Dockerfile . --push
|