Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Manual Runner Images Release #6

Manual Runner Images Release

Manual Runner Images Release #6

name: Manual Runner Images Release
on:
workflow_dispatch:
inputs:
runner_version:
description: 'Runner Version'
required: true
default: '2.307.1'
docker_version:
description: 'Docker Version'
required: false
default: '20.10.23'
runner_container_hooks_version:
description: 'Runner Container Hooks Version'
required: true
default: '0.3.2'
sha:
# If the sha is not provided, we'll default to the commit HEAD is pointing to
description: 'Commit Used To Build The Images'
required: false
default: ''
push_to_registries:
description: 'Push to registries'
required: true
type: boolean
default: true
troubleshoot:
description: 'Troubleshoot'
required: false
type: boolean
default: false
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
TARGET_ORG: adeepn-arc
TARGET_REPO: releases
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
build-runners:
name: Build ${{ matrix.name }}-${{ matrix.os-name }}-${{ matrix.os-version }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
fail-fast: false
matrix:
include:
- name: actions-runner
os-name: ubuntu
os-version: 20.04
latest: "true"
- name: actions-runner
os-name: ubuntu
os-version: 22.04
latest: "false"
- name: actions-runner-dind
os-name: ubuntu
os-version: 20.04
latest: "true"
- name: actions-runner-dind
os-name: ubuntu
os-version: 22.04
latest: "false"
- name: actions-runner-dind-rootless
os-name: ubuntu
os-version: 20.04
latest: "true"
- name: actions-runner-dind-rootless
os-name: ubuntu
os-version: 22.04
latest: "false"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Docker Environment
uses: ./.github/actions/setup-docker-environment
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
ghcr_username: ${{ github.actor }}
ghcr_password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
repository: adeepn-arc/actions-runner-controller
path: arc/
ref: ${{ inputs.sha }}
- name: Export env vars
run: |
echo "SHA_SHORT=$(git -C $GITHUB_WORKSPACE/arc rev-parse --short HEAD)" >> $GITHUB_ENV
echo "LATEST_TAG_DOCKER=${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest" >> $GITHUB_ENV
echo "LATEST_TAG_GHCR=ghcr.io/${{ env.TARGET_ORG }}/${{ env.TARGET_REPO }}/${{ matrix.name }}:latest" >> $GITHUB_ENV
- name: Build and Push Versioned Tags
uses: docker/build-push-action@v3
with:
context: ./arc/runner
file: ./arc/runner/${{ matrix.name }}.${{matrix.os-name}}-${{ matrix.os-version }}.dockerfile
platforms: linux/amd64,linux/arm64
pull: true
push: ${{ inputs.push_to_registries }}
build-args: |
RUNNER_VERSION=${{ inputs.runner_version }}
DOCKER_VERSION=${{ inputs.docker_version }}
RUNNER_CONTAINER_HOOKS_VERSION=${{ inputs.runner_container_hooks_version }}
tags: |
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:${{ matrix.os-name }}-${{ matrix.os-version }}
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ inputs.runner_version }}-${{ matrix.os-name }}-${{ matrix.os-version }}
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ inputs.runner_version }}-${{ matrix.os-name }}-${{ matrix.os-version }}-${{ env.SHA_SHORT }}
${{ matrix.latest == 'true' && env.LATEST_TAG_DOCKER || '' }}
ghcr.io/${{ env.TARGET_ORG }}/${{ env.TARGET_REPO }}/${{ matrix.name }}:${{ matrix.os-name }}-${{ matrix.os-version }}
ghcr.io/${{ env.TARGET_ORG }}/${{ env.TARGET_REPO }}/${{ matrix.name }}:v${{ inputs.runner_version }}-${{ matrix.os-name }}-${{ matrix.os-version }}
ghcr.io/${{ env.TARGET_ORG }}/${{ env.TARGET_REPO }}/${{ matrix.name }}:v${{ inputs.runner_version }}-${{ matrix.os-name }}-${{ matrix.os-version }}-${{ env.SHA_SHORT }}
${{ matrix.latest == 'true' && env.LATEST_TAG_GHCR || '' }}
cache-from: type=registry,ref=ghcr.io/${{ env.TARGET_ORG }}/${{ env.TARGET_REPO }}/${{ matrix.name }}:v${{ inputs.runner_version }}-${{ matrix.os-name }}-${{ matrix.os-version }}
cache-to: type=inline