-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (43 loc) · 1.3 KB
/
publish-image.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
name: Publish Runner Image
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/actions-runner
RUNNER_VERSION: 2.316.1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Docker buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
with:
push: ${{ github.event_name == 'push' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.RUNNER_VERSION}}
build-args: |
RUNNER_VERSION=${{ env.RUNNER_VERSION}}
RUNNER_CONTAINER_HOOKS_VERSION=0.5.0
TARGETOS=linux
TARGETARCH=amd64
DOCKER_VERSION=24.0.6
BUILDX_VERSION=0.11.2
cache-from: type=gha
cache-to: type=gha,mode=max