-
Notifications
You must be signed in to change notification settings - Fork 9
126 lines (117 loc) · 4.79 KB
/
release-runners.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Manual Runner Images Release
on:
workflow_dispatch:
inputs:
runner_version:
description: 'Runner Version'
required: true
default: '2.300.2'
docker_version:
description: 'Docker Version'
required: false
default: '20.10.12'
runner_container_hooks_version:
description: 'Runner Container Hooks Version'
required: true
default: '0.2.0'
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: false
troubleshoot:
description: 'Troubleshoot'
required: false
type: boolean
default: false
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
TARGET_ORG: actions-runner-controller
TARGET_REPO: actions-runner-controller
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: actions/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