Skip to content

Commit ffd9e20

Browse files
committed
.github/workflows/docker.yml: modernise
1 parent c6e1c67 commit ffd9e20

File tree

1 file changed

+41
-12
lines changed

1 file changed

+41
-12
lines changed

.github/workflows/docker.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,58 @@
1+
---
12
name: docker
23

34
on:
45
push:
56
tags:
67
- v*
78

9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
814
jobs:
9-
main:
15+
build:
1016
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
packages: write
21+
1122
steps:
23+
- name: Checkout
24+
uses: classabbyamp/treeless-checkout-action@v1
25+
26+
- name: Docker metadata
27+
id: meta
28+
uses: docker/metadata-action@v4
29+
with:
30+
images: |
31+
ghcr.io/${{ github.repository }}
32+
tags: |
33+
type=sha,prefix=
34+
type=ref,event=tag
35+
labels: |
36+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
37+
1238
- name: Set up QEMU
13-
uses: docker/setup-qemu-action@v1
39+
uses: docker/setup-qemu-action@v2
40+
1441
- name: Set up Docker Buildx
15-
uses: docker/setup-buildx-action@v1
42+
uses: docker/setup-buildx-action@v2
43+
1644
- name: Login to GCHR
17-
uses: docker/login-action@v1
45+
uses: docker/login-action@v2
1846
with:
1947
registry: ghcr.io
20-
username: void-robot
21-
password: ${{ secrets.CR_PAT }}
22-
- name: Set version
23-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
24-
- name: Build and push
25-
id: docker_build
26-
uses: docker/build-push-action@v2
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Build and push images
52+
id: build_and_push
53+
uses: docker/build-push-action@v3
2754
with:
2855
push: true
29-
tags: "ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}"
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
platforms: linux/amd64

0 commit comments

Comments
 (0)