Skip to content

Commit 4a7e7a0

Browse files
committed
update workflows
Signed-off-by: Markus Blaschke <[email protected]>
1 parent 97f5d41 commit 4a7e7a0

File tree

8 files changed

+195
-217
lines changed

8 files changed

+195
-217
lines changed

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
groups:
8+
all-github-actions:
9+
patterns: [ "*" ]
10+
11+
- package-ecosystem: "docker"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
groups:
16+
all-docker-versions:
17+
patterns: [ "*" ]
18+
19+
- package-ecosystem: "gomod"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
groups:
24+
all-go-mod-patch-and-minor:
25+
patterns: [ "*" ]
26+
update-types: [ "patch", "minor" ]

.github/workflows/build-docker.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
- uses: actions/setup-go@v5
22+
with:
23+
go-version-file: 'go.mod'
24+
cache-dependency-path: "go.sum"
25+
check-latest: true
26+
27+
- name: Run Golangci lint
28+
uses: golangci/golangci-lint-action@v7
29+
with:
30+
version: latest
31+
args: --print-resources-usage
32+
33+
build:
34+
name: "build ${{ matrix.Dockerfile }}:${{ matrix.target }}"
35+
needs: lint
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- Dockerfile: Dockerfile
41+
target: "final-static"
42+
suffix: ""
43+
latest: "auto"
44+
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set Swap Space
50+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
51+
with:
52+
swap-size-gb: 12
53+
54+
- uses: actions/setup-go@v5
55+
with:
56+
go-version-file: 'go.mod'
57+
cache-dependency-path: "go.sum"
58+
check-latest: true
59+
60+
- name: Docker meta
61+
id: docker_meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: |
65+
${{ github.repository }}
66+
quay.io/${{ github.repository }}
67+
labels: |
68+
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
69+
flavor: |
70+
latest=${{ matrix.latest }}
71+
suffix=${{ matrix.suffix }}
72+
73+
- name: Set up QEMU
74+
uses: docker/setup-qemu-action@v3
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Login to DockerHub
80+
uses: docker/login-action@v3
81+
if: ${{ inputs.publish }}
82+
with:
83+
username: ${{ secrets.DOCKERHUB_USERNAME }}
84+
password: ${{ secrets.DOCKERHUB_TOKEN }}
85+
86+
- name: Login to Quay
87+
uses: docker/login-action@v3
88+
if: ${{ inputs.publish }}
89+
with:
90+
registry: quay.io
91+
username: ${{ secrets.QUAY_USERNAME }}
92+
password: ${{ secrets.QUAY_TOKEN }}
93+
94+
- name: ${{ inputs.publish && 'Build and push' || 'Build' }}
95+
uses: docker/build-push-action@v6
96+
with:
97+
context: .
98+
file: ./${{ matrix.Dockerfile }}
99+
target: ${{ matrix.target }}
100+
platforms: linux/amd64,linux/arm64
101+
push: ${{ inputs.publish }}
102+
tags: ${{ steps.docker_meta.outputs.tags }}
103+
labels: ${{ steps.docker_meta.outputs.labels }}

.github/workflows/ci-docker.yaml

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,10 @@
1-
name: "CI docker"
1+
name: "ci/docker"
22

33
on: [pull_request, workflow_dispatch]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v2
10-
11-
- name: Set Swap Space
12-
uses: pierotofy/set-swap-space@master
13-
with:
14-
swap-size-gb: 12
15-
16-
- name: Run Golangci lint
17-
uses: golangci/golangci-lint-action@v2
18-
with:
19-
version: latest
20-
args: --print-resources-usage
21-
22-
- name: Docker meta
23-
id: docker_meta
24-
uses: docker/metadata-action@v3
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@v1
32-
33-
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v1
35-
36-
- name: Build
37-
uses: docker/build-push-action@v2
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Release: assets"
1+
name: "release/assets"
22

33
on:
44
release:
@@ -8,16 +8,17 @@ jobs:
88
release:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212

1313
- name: Set Swap Space
14-
uses: pierotofy/set-swap-space@master
14+
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c
1515
with:
1616
swap-size-gb: 12
1717

18-
- uses: actions/setup-go@v2
18+
- uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.19'
20+
go-version-file: 'go.mod'
21+
cache-dependency-path: "go.sum"
2122
check-latest: true
2223

2324
- name: Build

.github/workflows/release-docker.yaml

Lines changed: 9 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,17 @@
1-
name: "Release: docker"
1+
name: "release/docker"
22

33
on:
44
push:
55
branches:
6-
- '**'
6+
- 'main'
7+
- 'feature-**'
8+
- 'bugfix-**'
79
tags:
810
- '*.*.*'
911

1012
jobs:
11-
lint:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
16-
- name: Set Swap Space
17-
uses: pierotofy/set-swap-space@master
18-
with:
19-
swap-size-gb: 12
20-
21-
- name: Run Golangci lint
22-
uses: golangci/golangci-lint-action@v2
23-
with:
24-
version: latest
25-
args: --print-resources-usage
26-
27-
build:
28-
needs: lint
29-
strategy:
30-
fail-fast: false
31-
matrix:
32-
Dockerfile: [Dockerfile]
33-
suffix: [""]
34-
latest: ["auto"]
35-
include: []
36-
runs-on: ubuntu-latest
37-
steps:
38-
- uses: actions/checkout@v2
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@v1
58-
59-
- name: Set up Docker Buildx
60-
uses: docker/setup-buildx-action@v1
61-
62-
- name: Login to DockerHub
63-
uses: docker/login-action@v1
64-
with:
65-
username: ${{ secrets.DOCKERHUB_USERNAME }}
66-
password: ${{ secrets.DOCKERHUB_TOKEN }}
67-
68-
- name: Login to Quay
69-
uses: docker/login-action@v1
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@v2
77-
with:
78-
context: .
79-
file: ./${{ matrix.Dockerfile }}
80-
platforms: linux/amd64,linux/arm64
81-
push: ${{ github.event_name != 'pull_request' }}
82-
tags: ${{ steps.docker_meta.outputs.tags }}
83-
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' }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "schedule/docker"
2+
3+
on:
4+
schedule:
5+
- cron: '45 6 * * 1'
6+
7+
jobs:
8+
schedule:
9+
uses: ./.github/workflows/build-docker.yaml
10+
secrets: inherit
11+
with:
12+
publish: true

.github/workflows/scheduled-docker.yaml

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

0 commit comments

Comments
 (0)