87 lines
3.0 KiB
YAML
87 lines
3.0 KiB
YAML
name: Runners
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- 'runner/**'
|
|
- '!runner/Makefile'
|
|
- '.github/workflows/runners.yaml'
|
|
- '!**.md'
|
|
# We must do a trigger on a push: instead of a types: closed so GitHub Secrets
|
|
# are available to the workflow run
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- 'runner/**'
|
|
- '!runner/Makefile'
|
|
- '.github/workflows/runners.yaml'
|
|
- '!**.md'
|
|
|
|
env:
|
|
RUNNER_VERSION: 2.296.0
|
|
DOCKER_VERSION: 20.10.12
|
|
RUNNER_CONTAINER_HOOKS_VERSION: 0.1.2
|
|
DOCKERHUB_USERNAME: summerwind
|
|
|
|
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
|
|
- name: actions-runner-dind
|
|
os-name: ubuntu
|
|
os-version: 20.04
|
|
- name: actions-runner-dind-rootless
|
|
os-name: ubuntu
|
|
os-version: 20.04
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Docker Environment
|
|
id: vars
|
|
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: Build and Push Versioned Tags
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: ./runner
|
|
file: ./runner/${{ matrix.name }}.dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
build-args: |
|
|
RUNNER_VERSION=${{ env.RUNNER_VERSION }}
|
|
DOCKER_VERSION=${{ env.DOCKER_VERSION }}
|
|
RUNNER_CONTAINER_HOOKS_VERSION=${{ env.RUNNER_CONTAINER_HOOKS_VERSION }}
|
|
tags: |
|
|
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-${{ matrix.os-name }}-${{ matrix.os-version }}
|
|
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-${{ matrix.os-name }}-${{ matrix.os-version }}-${{ steps.vars.outputs.sha_short }}
|
|
${{ env.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest
|
|
ghcr.io/${{ github.repository }}/${{ matrix.name }}:latest
|
|
ghcr.io/${{ github.repository }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-${{ matrix.os-name }}-${{ matrix.os-version }}
|
|
ghcr.io/${{ github.repository }}/${{ matrix.name }}:v${{ env.RUNNER_VERSION }}-${{ matrix.os-name }}-${{ matrix.os-version }}-${{ steps.vars.outputs.sha_short }}
|
|
cache-from: type=gha,scope=build-${{ matrix.name }}
|
|
cache-to: type=gha,mode=max,scope=build-${{ matrix.name }}
|