Skip to content

Commit 65fcadc

Browse files
authored
fix: Use standard docker images naming (#64)
1 parent 777fc96 commit 65fcadc

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

.github/workflows/push.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ on:
2727
- 'README.md'
2828
- 'SECURITY.md'
2929

30+
env:
31+
TAG_NAME: ${{ github.event.release.tag_name || github.ref }}
32+
GITHUB_GROUP: ${{ github.repository_owner }}
33+
3034
concurrency:
3135
# On main/release, we don't want any jobs cancelled so the sha is used to name the group
3236
# On PR branches, we cancel the job if new commits are pushed
@@ -60,19 +64,9 @@ jobs:
6064
file: docker-zookeeper/docker/Dockerfile
6165
context: docker-zookeeper
6266
runs-on: ubuntu-latest
63-
name: ${{ matrix.component.name }}
6467
steps:
6568
- name: Checkout
6669
uses: actions/checkout@v4
67-
- name: Docker meta
68-
id: meta
69-
uses: docker/metadata-action@v5
70-
with:
71-
images: |
72-
ghcr.io/${{ github.repository_owner }}/${{ matrix.component.name }}
73-
tags: |
74-
type=ref,event=branch
75-
type=ref,event=tag
7670
- name: Set up QEMU
7771
uses: docker/setup-qemu-action@v3
7872
- name: Set up Docker Buildx
@@ -81,14 +75,18 @@ jobs:
8175
uses: docker/login-action@v3
8276
with:
8377
registry: ghcr.io
84-
username: ${{ github.actor }}
85-
password: ${{ secrets.GITHUB_TOKEN }}
78+
username: ${GITHUB_ACTOR}
79+
password: ${{secrets.GITHUB_TOKEN}}
80+
- name: Prepare Tag
81+
run: echo "TAG_NAME=$(echo ${TAG_NAME} | sed 's@refs/tags/@@;s@refs/heads/@@;s@/@_@g')" >> $GITHUB_ENV
82+
- name: Prepare Group
83+
run: echo "GITHUB_GROUP=${GITHUB_GROUP,,}" >> $GITHUB_ENV
8684
- name: Get package IDs for delete
8785
id: get-ids-for-delete
8886
uses: Netcracker/get-package-ids@v0.0.1
8987
with:
9088
component-name: ${{ matrix.component.name }}
91-
component-tag: ${{ steps.meta.outputs.tags }}
89+
component-tag: ${{ env.TAG_NAME }}
9290
access-token: ${{ secrets.GITHUB_TOKEN }}
9391
- name: Build and push
9492
uses: docker/build-push-action@v6
@@ -97,8 +95,6 @@ jobs:
9795
context: ${{ matrix.component.context }}
9896
file: ${{ matrix.component.file }}
9997
platforms: linux/amd64,linux/arm64
100-
# See https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#fetching-metadata-about-a-pull-request
10198
push: ${{ github.event_name != 'pull_request' && github.actor != 'dependabot[bot]' }}
102-
provenance: false
103-
tags: ${{ steps.meta.outputs.tags }}
104-
labels: ${{ steps.meta.outputs.labels }}
99+
tags: ghcr.io/${{ env.GITHUB_GROUP }}/${{ matrix.component.name }}:${{ env.TAG_NAME }}
100+
provenance: false

0 commit comments

Comments
 (0)