Skip to content

Commit 67e2967

Browse files
committed
update workflows
Signed-off-by: Markus Blaschke <[email protected]>
1 parent 173c6af commit 67e2967

File tree

5 files changed

+104
-194
lines changed

5 files changed

+104
-194
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: build/docker
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
publish:
7+
required: true
8+
type: boolean
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set Swap Space
17+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
18+
with:
19+
swap-size-gb: 12
20+
21+
- name: Run Golangci lint
22+
uses: golangci/golangci-lint-action@v3
23+
with:
24+
version: latest
25+
args: --print-resources-usage
26+
27+
build:
28+
name: "build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
29+
needs: lint
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- Dockerfile: Dockerfile
35+
target: "final-static"
36+
suffix: ""
37+
latest: "auto"
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Set Swap Space
43+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
44+
with:
45+
swap-size-gb: 12
46+
47+
- name: Docker meta
48+
id: docker_meta
49+
uses: docker/metadata-action@v5
50+
with:
51+
images: ${{ github.repository }},quay.io/${{ github.repository }}
52+
labels: |
53+
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
54+
flavor: |
55+
latest=${{ matrix.latest }}
56+
suffix=${{ matrix.suffix }}
57+
58+
- name: Set up QEMU
59+
uses: docker/setup-qemu-action@v3
60+
61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@v3
63+
64+
- name: Login to DockerHub
65+
uses: docker/login-action@v3
66+
if: ${{ inputs.publish }}
67+
with:
68+
username: ${{ secrets.DOCKERHUB_USERNAME }}
69+
password: ${{ secrets.DOCKERHUB_TOKEN }}
70+
71+
- name: Login to Quay
72+
uses: docker/login-action@v3
73+
if: ${{ inputs.publish }}
74+
with:
75+
registry: quay.io
76+
username: ${{ secrets.QUAY_USERNAME }}
77+
password: ${{ secrets.QUAY_TOKEN }}
78+
79+
- name: ${{ inputs.publish && 'Build and push' || 'Build' }}
80+
uses: docker/build-push-action@v5
81+
with:
82+
context: .
83+
file: ./${{ matrix.Dockerfile }}
84+
target: ${{ matrix.target }}
85+
platforms: linux/amd64,linux/arm64
86+
push: ${{ inputs.publish }}
87+
tags: ${{ steps.docker_meta.outputs.tags }}
88+
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@v3
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@v4
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@v2
32-
33-
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v2
35-
36-
- name: Build
37-
uses: docker/build-push-action@v4
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
@@ -8,7 +8,7 @@ jobs:
88
release:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212

1313
- name: Set Swap Space
1414
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c

.github/workflows/release-docker.yaml

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

1212
jobs:
13-
lint:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v3
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-static"
39-
suffix: ""
40-
latest: "auto"
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@v3
44-
45-
- name: Set Swap Space
46-
uses: pierotofy/set-swap-space@master
47-
with:
48-
swap-size-gb: 12
49-
50-
- name: Docker meta
51-
id: docker_meta
52-
uses: docker/metadata-action@v4
53-
with:
54-
images: ${{ github.repository }},quay.io/${{ github.repository }}
55-
labels: |
56-
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
57-
flavor: |
58-
latest=${{ matrix.latest }}
59-
suffix=${{ matrix.suffix }}
60-
61-
- name: Set up QEMU
62-
uses: docker/setup-qemu-action@v2
63-
64-
- name: Set up Docker Buildx
65-
uses: docker/setup-buildx-action@v2
66-
67-
- name: Login to DockerHub
68-
uses: docker/login-action@v2
69-
with:
70-
username: ${{ secrets.DOCKERHUB_USERNAME }}
71-
password: ${{ secrets.DOCKERHUB_TOKEN }}
72-
73-
- name: Login to Quay
74-
uses: docker/login-action@v2
75-
with:
76-
registry: quay.io
77-
username: ${{ secrets.QUAY_USERNAME }}
78-
password: ${{ secrets.QUAY_TOKEN }}
79-
80-
- name: Build and push
81-
uses: docker/build-push-action@v4
82-
with:
83-
context: .
84-
file: ./${{ matrix.Dockerfile }}
85-
target: ${{ matrix.target }}
86-
platforms: linux/amd64,linux/arm64
87-
push: ${{ github.event_name != 'pull_request' }}
88-
tags: ${{ steps.docker_meta.outputs.tags }}
89-
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 & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +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@v3
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-static"
34-
suffix: ""
35-
latest: "auto"
36-
runs-on: ubuntu-latest
37-
steps:
38-
- uses: actions/checkout@v3
39-
40-
- name: Set Swap Space
41-
uses: pierotofy/set-swap-space@master
42-
with:
43-
swap-size-gb: 12
44-
45-
- name: Docker meta
46-
id: docker_meta
47-
uses: docker/metadata-action@v4
48-
with:
49-
images: ${{ github.repository }},quay.io/${{ github.repository }}
50-
labels: |
51-
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
52-
flavor: |
53-
latest=${{ matrix.latest }}
54-
suffix=${{ matrix.suffix }}
55-
56-
- name: Set up QEMU
57-
uses: docker/setup-qemu-action@v2
58-
59-
- name: Set up Docker Buildx
60-
uses: docker/setup-buildx-action@v2
61-
62-
- name: Login to DockerHub
63-
uses: docker/login-action@v2
64-
with:
65-
username: ${{ secrets.DOCKERHUB_USERNAME }}
66-
password: ${{ secrets.DOCKERHUB_TOKEN }}
67-
68-
- name: Login to Quay
69-
uses: docker/login-action@v2
70-
with:
71-
registry: quay.io
72-
username: ${{ secrets.QUAY_USERNAME }}
73-
password: ${{ secrets.QUAY_TOKEN }}
74-
75-
- name: Build and push
76-
uses: docker/build-push-action@v4
77-
with:
78-
context: .
79-
file: ./${{ matrix.Dockerfile }}
80-
target: ${{ matrix.target }}
81-
platforms: linux/amd64,linux/arm64
82-
push: ${{ github.event_name != 'pull_request' }}
83-
tags: ${{ steps.docker_meta.outputs.tags }}
84-
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)