Skip to content

Commit fa6ee91

Browse files
authored
ci: fix push to github docker registry (#1108)
* fix: ci push to docker registry * ci: upgrade gh actions * ci: cancel jobs if a new one is queued
1 parent 18791db commit fa6ee91

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/docker.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
branches:
1010
- main
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
14+
cancel-in-progress: true
15+
1216
env:
1317
GIT_LFS_SKIP_SMUDGE: 1
1418

@@ -25,12 +29,12 @@ jobs:
2529
matrix:
2630
images:
2731
- path: "docker/namadillo/Dockerfile"
28-
tag: "namadillo"
32+
tag: "namadillo-main"
2933
- path: "docker/faucet/Dockerfile"
30-
tag: "faucet-interface"
34+
tag: "faucet-interface-main"
3135

3236
steps:
33-
- name: Checkout repo
37+
- name: Checkout repository
3438
uses: actions/checkout@v4
3539
- name: Set up QEMU
3640
uses: docker/setup-qemu-action@v3
@@ -42,12 +46,19 @@ jobs:
4246
registry: ghcr.io
4347
username: ${{ github.repository_owner }}
4448
password: ${{ secrets.GITHUB_TOKEN }}
49+
- name: Docker meta
50+
id: meta
51+
uses: docker/metadata-action@v4
52+
with:
53+
images: ghcr.io/${{ github.repository_owner }}/namada-interface
54+
tags: type=raw,value=${{ matrix.images.tag }}
4555
- name: Build and Push docker image
46-
uses: docker/build-push-action@v3
56+
uses: docker/build-push-action@v6
4757
with:
4858
context: .
4959
file: ${{ matrix.images.path }}
5060
push: ${{ github.ref == 'refs/heads/main' }}
51-
tags: ${{ matrix.images.tag }}-latest, ${{ matrix.images.tag }}-main
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
5263
cache-from: type=gha
5364
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)