Skip to content

Commit 5d29e35

Browse files
committed
chore(ci): update ci pipelines to use the proper runners
1 parent bdb403e commit 5d29e35

File tree

4 files changed

+60
-26
lines changed

4 files changed

+60
-26
lines changed

.github/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
- title: Fixes
55
labels: [bug, fix, patch]
66
- title: Other
7-
labels: [chore]
7+
labels: [chore]

.github/workflows/build.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ on:
88
branches:
99
- main
1010

11+
env:
12+
IMAGE_NAME: podmortem-log-parser
13+
DOCKERFILE: ./src/main/docker/Dockerfile.native
14+
DEP_STAGE: dependencies
15+
1116
jobs:
1217
warm-cache:
1318
name: Warm Dependencies Cache
14-
runs-on: self-hosted
19+
runs-on: [self-hosted, linux]
1520
permissions:
1621
contents: read
1722
packages: write
@@ -34,16 +39,16 @@ jobs:
3439
uses: docker/build-push-action@v6
3540
with:
3641
context: .
37-
file: ./src/main/docker/Dockerfile.native
38-
target: dependencies
42+
file: ${{ env.DOCKERFILE }}
43+
target: ${{ env.DEP_STAGE }}
3944
platforms: linux/amd64
4045
push: ${{ github.event_name == 'push' }}
4146
cache-from: type=gha,scope=deps
4247
cache-to: |
4348
type=gha,mode=max,scope=deps
44-
${{ github.event_name == 'push' && format('type=registry,ref=ghcr.io/{0}/podmortem-log-parser:deps-cache,mode=max', github.repository_owner) || '' }}
49+
${{ github.event_name == 'push' && format('type=registry,ref=ghcr.io/{0}/{1}:deps-cache,mode=max', github.repository_owner, env.IMAGE_NAME) || '' }}
4550
tags: |
46-
${{ github.event_name == 'push' && format('ghcr.io/{0}/podmortem-log-parser:deps-cache', github.repository_owner) || '' }}
51+
${{ github.event_name == 'push' && format('ghcr.io/{0}/{1}:deps-cache', github.repository_owner, env.IMAGE_NAME) || '' }}
4752
build-args: |
4853
GITHUB_USER=${{ github.actor }}
4954
secrets: |
@@ -53,7 +58,7 @@ jobs:
5358
name: Test Build
5459
if: github.event_name == 'pull_request'
5560
needs: warm-cache
56-
runs-on: self-hosted
61+
runs-on: [self-hosted, linux]
5762
steps:
5863
- name: Checkout repository
5964
uses: actions/checkout@v4
@@ -65,7 +70,7 @@ jobs:
6570
uses: docker/build-push-action@v6
6671
with:
6772
context: .
68-
file: ./src/main/docker/Dockerfile.native
73+
file: ${{ env.DOCKERFILE }}
6974
platforms: linux/amd64
7075
push: false
7176
cache-from: |
@@ -81,18 +86,19 @@ jobs:
8186
name: Build ${{ matrix.arch }}
8287
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
8388
needs: warm-cache
84-
runs-on: self-hosted
89+
runs-on: ${{ matrix.runner }}
8590
permissions:
8691
contents: read
8792
packages: write
8893
strategy:
8994
matrix:
90-
arch: [amd64, arm64]
9195
include:
9296
- arch: amd64
9397
platform: linux/amd64
98+
runner: [self-hosted, linux]
9499
- arch: arm64
95100
platform: linux/arm64
101+
runner: ubuntu-22.04-arm
96102
steps:
97103
- name: Checkout repository
98104
uses: actions/checkout@v4
@@ -111,15 +117,15 @@ jobs:
111117
uses: docker/build-push-action@v6
112118
with:
113119
context: .
114-
file: ./src/main/docker/Dockerfile.native
120+
file: ${{ env.DOCKERFILE }}
115121
platforms: ${{ matrix.platform }}
116122
push: true
117123
cache-from: |
118124
type=gha,scope=deps
119125
type=gha,scope=build-${{ matrix.arch }}
120-
cache-to: type=gha,mode=max,scope=build-${{ matrix.arch }}
126+
cache-to: type=gha,mode=max,scope=build-amd64
121127
tags: |
122-
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-${{ matrix.arch }}
128+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-${{ matrix.arch }}
123129
build-args: |
124130
GITHUB_USER=${{ github.actor }}
125131
secrets: |
@@ -129,7 +135,7 @@ jobs:
129135
name: Create Multi-Arch Manifest
130136
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
131137
needs: build-arch
132-
runs-on: self-hosted
138+
runs-on: [self-hosted, linux]
133139
permissions:
134140
contents: read
135141
packages: write
@@ -143,10 +149,10 @@ jobs:
143149

144150
- name: Create and push multi-arch manifest
145151
run: |
146-
docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest \
147-
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-amd64 \
148-
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-arm64
152+
docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest \
153+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \
154+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
149155
150-
docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }} \
151-
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-amd64 \
152-
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}-arm64
156+
docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
157+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-amd64 \
158+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-arm64
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Cleanup Old Development Images
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * 1'
6+
workflow_dispatch:
7+
8+
env:
9+
IMAGE_NAME: podmortem-log-parser
10+
11+
jobs:
12+
cleanup:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Delete old development images
19+
uses: actions/delete-package-versions@v5
20+
with:
21+
owner: podmortem
22+
package-name: ${{ env.IMAGE_NAME }}
23+
package-type: 'container'
24+
min-versions-to-keep: 20
25+
# Ignore release tags (v1.2.3 pattern), latest, and deps-cache
26+
ignore-versions: '^(v\d+\.\d+\.\d+.*|latest|deps-cache)$'
27+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313
warm-cache:
14-
runs-on: self-hosted
14+
runs-on: [self-hosted, linux]
1515
permissions: {contents: read, packages: write}
1616
steps:
1717
- uses: actions/checkout@v4
@@ -42,16 +42,17 @@ jobs:
4242

4343
build-arch:
4444
needs: warm-cache
45-
runs-on: self-hosted
45+
runs-on: ${{ matrix.runner }}
4646
permissions: {contents: read, packages: write}
4747
strategy:
4848
matrix:
49-
arch: [amd64, arm64]
5049
include:
5150
- arch: amd64
5251
platform: linux/amd64
52+
runner: [self-hosted, linux]
5353
- arch: arm64
5454
platform: linux/arm64
55+
runner: ubuntu-22.04-arm
5556
steps:
5657
- uses: actions/checkout@v4
5758
- uses: docker/setup-buildx-action@v3
@@ -79,7 +80,7 @@ jobs:
7980

8081
manifest:
8182
needs: build-arch
82-
runs-on: self-hosted
83+
runs-on: [self-hosted, linux]
8384
permissions: {contents: read, packages: write}
8485
steps:
8586
- uses: docker/login-action@v3
@@ -99,11 +100,11 @@ jobs:
99100
100101
release-notes:
101102
needs: manifest
102-
runs-on: self-hosted
103+
runs-on: [self-hosted, linux]
103104
permissions: {contents: write}
104105
steps:
105106
- name: Generate GitHub Release
106107
uses: softprops/action-gh-release@v1
107108
with:
108109
tag_name: ${{ github.ref_name }}
109-
generate_release_notes: true
110+
generate_release_notes: true

0 commit comments

Comments
 (0)