mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:30:59 +00:00
In #306 we seem to have accidentally updated a wrong workflow, which was for runner builds. This updates the one for the controller. Resolves #302
71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
name: Build and Release Runners
|
|
|
|
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
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: Build ${{ matrix.name }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- name: actions-runner
|
|
dockerfile: Dockerfile
|
|
- name: actions-runner-dind
|
|
dockerfile: dindrunner.Dockerfile
|
|
env:
|
|
RUNNER_VERSION: 2.276.1
|
|
DOCKER_VERSION: 19.03.12
|
|
DOCKERHUB_USERNAME: ${{ github.repository_owner }}
|
|
steps:
|
|
- name: Set outputs
|
|
id: vars
|
|
run: echo ::set-output name=sha_short::${GITHUB_SHA::7}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
version: latest
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
if: ${{ github.event_name == 'push' }}
|
|
with:
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: ./runner
|
|
file: ./runner/${{ matrix.dockerfile }}
|
|
platforms: linux/amd64,linux/arm64
|
|
build-args: |
|
|
RUNNER_VERSION=${{ env.RUNNER_VERSION }}
|
|
DOCKER_VERSION=${{ env.DOCKER_VERSION }}
|
|
tags: |
|
|
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}
|
|
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-${{ steps.vars.outputs.sha_short }}
|
|
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest
|