Skip to content

Commit cb4cd24

Browse files
committed
add workflow call into publish-runner.yaml
Signed-off-by: Denis Baryshev <dennybaa@gmail.com>
1 parent bff5081 commit cb4cd24

File tree

4 files changed

+126
-88
lines changed

4 files changed

+126
-88
lines changed

.github/workflows/publish-images.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Publish Images
22

33
on:
44
workflow_dispatch:
5+
push:
6+
paths:
7+
- images/*.containerfile
58

69
env:
710
REGISTRY: ghcr.io

.github/workflows/publish-runner.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Publish Runner Image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
images:
7+
type: string
8+
description: 'Images passed docker/metadata-action'
9+
required: true
10+
version:
11+
type: string
12+
description: Runner version (when empty the version set a containerfile is used)
13+
default: ''
14+
15+
workflow_call:
16+
inputs:
17+
images:
18+
type: string
19+
description: 'Images passed docker/metadata-action'
20+
required: true
21+
version:
22+
type: string
23+
description: Runner version (when empty the version set a containerfile is used)
24+
default: ''
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
packages: write
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Runner Version
38+
id: runner
39+
run: |
40+
version="${{ inputs.version }}"; version="${version#v}"
41+
from_file="$(cat runners/podman.containerfile |
42+
sed -En '/ARG\s+RUNNER_VERSION/ { s/ARG\s+RUNNER_VERSION=//; p; }')"
43+
echo "version=${version:-$from_file}" >> $GITHUB_OUTPUT
44+
45+
- name: Rolling tag
46+
uses: bitdeps/rolling-tag@v1
47+
id: roll
48+
with:
49+
version: ${{ steps.runner.outputs.version }}
50+
releases-only: false
51+
52+
- name: Docker meta
53+
id: meta
54+
uses: docker/metadata-action@v5
55+
with:
56+
images: ${{ github.event.inputs.images }}
57+
tags: |
58+
type=raw,value=${{ steps.roll.outputs.tag }}
59+
type=raw,value=${{ steps.roll.outputs.version }}
60+
type=raw,value=latest,enable=${{ steps.roll.outputs.updates-latest == 'true' }}
61+
62+
- name: Setup Docker buildx
63+
uses: docker/setup-buildx-action@v3
64+
65+
- name: Log into registry ${{ env.REGISTRY }}
66+
uses: docker/login-action@v3
67+
with:
68+
registry: ${{ env.REGISTRY }}
69+
username: ${{ github.actor }}
70+
password: ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Build and push Docker image
73+
id: build-and-push
74+
uses: docker/build-push-action@v5
75+
with:
76+
file: runners/podman.containerfile
77+
context: ./runners
78+
push: true
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
platforms: |
82+
linux/amd64
83+
build-args: |
84+
RUNNER_VERSION=${{ steps.runner.outputs.version }}
85+
86+
- name: Create Tag
87+
uses: mathieudutour/github-tag-action@v6.2
88+
with:
89+
custom_tag: ${{ steps.roll.outputs.tag }}

.github/workflows/publish-runners.yaml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
paths:
6+
- runners/podman.containerfile
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
version: ${{ steps.outputs.runner.version }}
13+
14+
15+
release:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: update
19+
id: update
20+
uses: ./.github/workflows/update-image.yaml
21+
with:
22+
file: runners/podman.containerfile
23+
arg: RUNNER_VERSION
24+
25+
- name: Publish image
26+
uses: benc-uk/workflow-dispatch@v1
27+
with:
28+
workflow: publush-runner.yaml
29+
inputs: '{ "version": "${{ steps.update.outputs.version }}" }'
30+
31+
- name: Create Release
32+
uses: softprops/action-gh-release@v2
33+
with:
34+
tag_name: ${{ steps.update.outputs.tag }}

0 commit comments

Comments
 (0)