74 lines
2.5 KiB
YAML
74 lines
2.5 KiB
YAML
name: Runners
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
- closed
|
|
branches:
|
|
- 'master'
|
|
paths:
|
|
- 'runner/**'
|
|
- .github/workflows/runners.yml
|
|
- '!**.md'
|
|
|
|
env:
|
|
RUNNER_VERSION: 2.288.1
|
|
DOCKER_VERSION: 20.10.12
|
|
DOCKERHUB_USERNAME: summerwind
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
packages: write
|
|
contents: read
|
|
name: Build ${{ matrix.name }}-${{ matrix.os-name }}-${{ matrix.os-version }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: actions-runner
|
|
os-name: ubuntu
|
|
os-version: 20.04
|
|
dockerfile: Dockerfile
|
|
- name: actions-runner-dind
|
|
os-name: ubuntu
|
|
os-version: 20.04
|
|
dockerfile: Dockerfile.dindrunner
|
|
|
|
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@v2
|
|
with:
|
|
context: ./runner
|
|
file: ./runner/${{ matrix.dockerfile }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.ref == 'master' && github.event.pull_request.merged == true }}
|
|
build-args: |
|
|
RUNNER_VERSION=${{ env.RUNNER_VERSION }}
|
|
DOCKER_VERSION=${{ env.DOCKER_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
|
|
cache-to: type=gha,mode=max
|