Skip to content

Commit 4f2e74e

Browse files
committed
update workflows
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent 944ed6b commit 4f2e74e

5 files changed

Lines changed: 54 additions & 241 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,56 +1,64 @@
1-
name: "Release: docker"
1+
name: build/docker
22

33
on:
4-
push:
5-
branches:
6-
- '**'
7-
tags:
8-
- '*.*.*'
4+
workflow_call:
5+
inputs:
6+
publish:
7+
required: true
8+
type: boolean
99

1010
jobs:
1111
lint:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515

1616
- name: Set Swap Space
17-
uses: pierotofy/set-swap-space@master
17+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
1818
with:
1919
swap-size-gb: 12
2020

2121
- name: Run Golangci lint
22-
uses: golangci/golangci-lint-action@v2
22+
uses: golangci/golangci-lint-action@v3
2323
with:
2424
version: latest
2525
args: --print-resources-usage
2626

2727
build:
28+
name: "build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
2829
needs: lint
2930
strategy:
3031
fail-fast: false
3132
matrix:
32-
Dockerfile: [Dockerfile.ubuntu]
33-
suffix: ["-ubuntu"]
34-
latest: ["auto"]
3533
include:
36-
- Dockerfile: Dockerfile.alpine
37-
suffix: -alpine
34+
-
35+
Dockerfile: Dockerfile
36+
target: "final-ubuntu"
37+
suffix: "-ubuntu"
38+
latest: "auto"
39+
-
40+
Dockerfile: Dockerfile
41+
target: "final-alpine"
42+
suffix: "-alpine"
3843
latest: false
39-
- Dockerfile: Dockerfile.debian
40-
suffix: -debian
44+
-
45+
Dockerfile: Dockerfile
46+
target: "final-debian"
47+
suffix: "-debian"
4148
latest: false
49+
4250
runs-on: ubuntu-latest
4351
steps:
44-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v4
4553

4654
- name: Set Swap Space
47-
uses: pierotofy/set-swap-space@master
55+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
4856
with:
4957
swap-size-gb: 12
5058

5159
- name: Docker meta
5260
id: docker_meta
53-
uses: docker/metadata-action@v4
61+
uses: docker/metadata-action@v5
5462
with:
5563
images: ${{ github.repository }},quay.io/${{ github.repository }}
5664
labels: |
@@ -60,30 +68,33 @@ jobs:
6068
suffix=${{ matrix.suffix }}
6169
6270
- name: Set up QEMU
63-
uses: docker/setup-qemu-action@v1
71+
uses: docker/setup-qemu-action@v3
6472

6573
- name: Set up Docker Buildx
66-
uses: docker/setup-buildx-action@v1
74+
uses: docker/setup-buildx-action@v3
6775

6876
- name: Login to DockerHub
69-
uses: docker/login-action@v1
77+
uses: docker/login-action@v3
78+
if: ${{ inputs.publish }}
7079
with:
7180
username: ${{ secrets.DOCKERHUB_USERNAME }}
7281
password: ${{ secrets.DOCKERHUB_TOKEN }}
7382

7483
- name: Login to Quay
75-
uses: docker/login-action@v1
84+
uses: docker/login-action@v3
85+
if: ${{ inputs.publish }}
7686
with:
7787
registry: quay.io
7888
username: ${{ secrets.QUAY_USERNAME }}
7989
password: ${{ secrets.QUAY_TOKEN }}
8090

81-
- name: Build and push
82-
uses: docker/build-push-action@v2
91+
- name: ${{ inputs.publish && 'Build and push' || 'Build' }}
92+
uses: docker/build-push-action@v5
8393
with:
8494
context: .
8595
file: ./${{ matrix.Dockerfile }}
86-
platforms: linux/amd64,linux/arm64,linux/arm
87-
push: ${{ github.event_name != 'pull_request' }}
96+
target: ${{ matrix.target }}
97+
platforms: linux/amd64,linux/arm64
98+
push: ${{ inputs.publish }}
8899
tags: ${{ steps.docker_meta.outputs.tags }}
89100
labels: ${{ steps.docker_meta.outputs.labels }}

.github/workflows/ci-docker.yaml

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,7 @@ on: [pull_request, workflow_dispatch]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v4
10-
11-
- name: Set Swap Space
12-
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
13-
with:
14-
swap-size-gb: 12
15-
16-
- name: Run Golangci lint
17-
uses: golangci/golangci-lint-action@v3
18-
with:
19-
version: latest
20-
args: --print-resources-usage
21-
22-
- name: Docker meta
23-
id: docker_meta
24-
uses: docker/metadata-action@v5
25-
with:
26-
images: ${{ github.repository }},quay.io/${{ github.repository }}
27-
labels: |
28-
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
29-
30-
- name: Set up QEMU
31-
uses: docker/setup-qemu-action@v3
32-
33-
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v3
35-
36-
- name: Build
37-
uses: docker/build-push-action@v5
38-
with:
39-
context: .
40-
file: ./Dockerfile
41-
push: false
42-
platforms: linux/amd64,linux/arm64
43-
tags: ${{ steps.docker_meta.outputs.tags }}
44-
labels: ${{ steps.docker_meta.outputs.labels }}
7+
uses: ./.github/workflows/build-docker.yaml
8+
secrets: inherit
9+
with:
10+
publish: false

.github/workflows/release-assets.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
swap-size-gb: 12
1717

18-
- uses: actions/setup-go@v4
18+
- uses: actions/setup-go@v5
1919
with:
2020
go-version: '1.21'
2121
check-latest: true

.github/workflows/release-docker.yaml

Lines changed: 5 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -10,90 +10,8 @@ on:
1010
- '*.*.*'
1111

1212
jobs:
13-
lint:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: Set Swap Space
19-
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
20-
with:
21-
swap-size-gb: 12
22-
23-
- name: Run Golangci lint
24-
uses: golangci/golangci-lint-action@v3
25-
with:
26-
version: latest
27-
args: --print-resources-usage
28-
29-
build:
30-
name: "build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
31-
needs: lint
32-
strategy:
33-
fail-fast: false
34-
matrix:
35-
include:
36-
-
37-
Dockerfile: Dockerfile
38-
target: "final-ubuntu"
39-
suffix: "-ubuntu"
40-
latest: "auto"
41-
-
42-
Dockerfile: Dockerfile
43-
target: "final-alpine"
44-
suffix: "-alpine"
45-
latest: false
46-
-
47-
Dockerfile: Dockerfile
48-
target: "final-debian"
49-
suffix: "-debian"
50-
latest: false
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v4
54-
55-
- name: Set Swap Space
56-
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
57-
with:
58-
swap-size-gb: 12
59-
60-
- name: Docker meta
61-
id: docker_meta
62-
uses: docker/metadata-action@v5
63-
with:
64-
images: ${{ github.repository }},quay.io/${{ github.repository }}
65-
labels: |
66-
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
67-
flavor: |
68-
latest=${{ matrix.latest }}
69-
suffix=${{ matrix.suffix }}
70-
71-
- name: Set up QEMU
72-
uses: docker/setup-qemu-action@v3
73-
74-
- name: Set up Docker Buildx
75-
uses: docker/setup-buildx-action@v3
76-
77-
- name: Login to DockerHub
78-
uses: docker/login-action@v3
79-
with:
80-
username: ${{ secrets.DOCKERHUB_USERNAME }}
81-
password: ${{ secrets.DOCKERHUB_TOKEN }}
82-
83-
- name: Login to Quay
84-
uses: docker/login-action@v3
85-
with:
86-
registry: quay.io
87-
username: ${{ secrets.QUAY_USERNAME }}
88-
password: ${{ secrets.QUAY_TOKEN }}
89-
90-
- name: Build and push
91-
uses: docker/build-push-action@v5
92-
with:
93-
context: .
94-
file: ./${{ matrix.Dockerfile }}
95-
target: ${{ matrix.target }}
96-
platforms: linux/amd64,linux/arm64
97-
push: ${{ github.event_name != 'pull_request' }}
98-
tags: ${{ steps.docker_meta.outputs.tags }}
99-
labels: ${{ steps.docker_meta.outputs.labels }}
13+
release:
14+
uses: ./.github/workflows/build-docker.yaml
15+
secrets: inherit
16+
with:
17+
publish: ${{ github.event_name != 'pull_request' }}

.github/workflows/schedule-docker.yaml

Lines changed: 6 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -2,93 +2,11 @@ name: "schedule/docker"
22

33
on:
44
schedule:
5-
- cron: '0 6 * * 1'
5+
- cron: '45 6 * * 1'
66

77
jobs:
8-
lint:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
13-
- name: Set Swap Space
14-
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
15-
with:
16-
swap-size-gb: 12
17-
18-
- name: Run Golangci lint
19-
uses: golangci/golangci-lint-action@v3
20-
with:
21-
version: latest
22-
args: --print-resources-usage
23-
24-
build:
25-
name: "build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
26-
needs: lint
27-
strategy:
28-
fail-fast: false
29-
matrix:
30-
include:
31-
-
32-
Dockerfile: Dockerfile
33-
target: "final-ubuntu"
34-
suffix: "-ubuntu"
35-
latest: "auto"
36-
-
37-
Dockerfile: Dockerfile
38-
target: "final-alpine"
39-
suffix: "-alpine"
40-
latest: false
41-
-
42-
Dockerfile: Dockerfile
43-
target: "final-debian"
44-
suffix: "-debian"
45-
latest: false
46-
runs-on: ubuntu-latest
47-
steps:
48-
- uses: actions/checkout@v4
49-
50-
- name: Set Swap Space
51-
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
52-
with:
53-
swap-size-gb: 12
54-
55-
- name: Docker meta
56-
id: docker_meta
57-
uses: docker/metadata-action@v5
58-
with:
59-
images: ${{ github.repository }},quay.io/${{ github.repository }}
60-
labels: |
61-
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
62-
flavor: |
63-
latest=${{ matrix.latest }}
64-
suffix=${{ matrix.suffix }}
65-
66-
- name: Set up QEMU
67-
uses: docker/setup-qemu-action@v3
68-
69-
- name: Set up Docker Buildx
70-
uses: docker/setup-buildx-action@v3
71-
72-
- name: Login to DockerHub
73-
uses: docker/login-action@v3
74-
with:
75-
username: ${{ secrets.DOCKERHUB_USERNAME }}
76-
password: ${{ secrets.DOCKERHUB_TOKEN }}
77-
78-
- name: Login to Quay
79-
uses: docker/login-action@v3
80-
with:
81-
registry: quay.io
82-
username: ${{ secrets.QUAY_USERNAME }}
83-
password: ${{ secrets.QUAY_TOKEN }}
84-
85-
- name: Build and push
86-
uses: docker/build-push-action@v5
87-
with:
88-
context: .
89-
file: ./${{ matrix.Dockerfile }}
90-
target: ${{ matrix.target }}
91-
platforms: linux/amd64,linux/arm64
92-
push: ${{ github.event_name != 'pull_request' }}
93-
tags: ${{ steps.docker_meta.outputs.tags }}
94-
labels: ${{ steps.docker_meta.outputs.labels }}
8+
schedule:
9+
uses: ./.github/workflows/build-docker.yaml
10+
secrets: inherit
11+
with:
12+
publish: true

0 commit comments

Comments
 (0)