Skip to content

Commit edf4474

Browse files
fix: lowercase repository name in docker tags, clean up manifest tags
1 parent 0c03d08 commit edf4474

2 files changed

Lines changed: 39 additions & 32 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ jobs:
4646
password: ${{ secrets.GITHUB_TOKEN }}
4747

4848
- name: Build and push amd64
49-
uses: docker/build-push-action@v6
50-
with:
51-
context: .
52-
push: true
53-
platforms: linux/amd64
54-
tags: ghcr.io/${{ github.repository }}:sha-${{ github.sha }}-amd64
55-
cache-from: type=gha,scope=amd64
56-
cache-to: type=gha,mode=max,scope=amd64
57-
build-args: |
58-
JWT_SECRET=change-me-in-production
59-
BACKEND_URL=http://localhost:8000
49+
run: |
50+
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
51+
docker buildx build \
52+
--platform linux/amd64 \
53+
--push \
54+
--cache-from type=gha,scope=amd64 \
55+
--cache-to type=gha,mode=max,scope=amd64 \
56+
--build-arg JWT_SECRET=change-me-in-production \
57+
--build-arg BACKEND_URL=http://localhost:8000 \
58+
--tag ghcr.io/${REPO}:sha-${{ github.sha }}-amd64 \
59+
.
6060
6161
build-arm64:
6262
needs: check-release
@@ -79,17 +79,17 @@ jobs:
7979
password: ${{ secrets.GITHUB_TOKEN }}
8080

8181
- name: Build and push arm64
82-
uses: docker/build-push-action@v6
83-
with:
84-
context: .
85-
push: true
86-
platforms: linux/arm64
87-
tags: ghcr.io/${{ github.repository }}:sha-${{ github.sha }}-arm64
88-
cache-from: type=gha,scope=arm64
89-
cache-to: type=gha,mode=max,scope=arm64
90-
build-args: |
91-
JWT_SECRET=change-me-in-production
92-
BACKEND_URL=http://localhost:8000
82+
run: |
83+
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
84+
docker buildx build \
85+
--platform linux/arm64 \
86+
--push \
87+
--cache-from type=gha,scope=arm64 \
88+
--cache-to type=gha,mode=max,scope=arm64 \
89+
--build-arg JWT_SECRET=change-me-in-production \
90+
--build-arg BACKEND_URL=http://localhost:8000 \
91+
--tag ghcr.io/${REPO}:sha-${{ github.sha }}-arm64 \
92+
.
9393
9494
merge-manifest:
9595
needs: [build-amd64, build-arm64]
@@ -107,8 +107,9 @@ jobs:
107107

108108
- name: Create and push multi-platform manifest
109109
run: |
110+
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
110111
docker buildx imagetools create \
111-
--tag ghcr.io/${{ github.repository }}:latest \
112-
--tag ghcr.io/${{ github.repository }}:sha-${{ github.sha }} \
113-
ghcr.io/${{ github.repository }}:sha-${{ github.sha }}-amd64 \
114-
ghcr.io/${{ github.repository }}:sha-${{ github.sha }}-arm64
112+
--tag ghcr.io/${REPO}:latest \
113+
--tag ghcr.io/${REPO}:sha-${{ github.sha }} \
114+
ghcr.io/${REPO}:sha-${{ github.sha }}-amd64 \
115+
ghcr.io/${REPO}:sha-${{ github.sha }}-arm64

.github/workflows/release-please.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ jobs:
4444

4545
- name: Build and push amd64
4646
uses: docker/build-push-action@v6
47+
env:
48+
REPO: ${{ github.repository }}
4749
with:
4850
context: .
4951
push: true
5052
platforms: linux/amd64
51-
tags: ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }}-amd64
53+
tags: ghcr.io/${{ env.REPO }}:${{ needs.release-please.outputs.tag_name }}-amd64
5254
cache-from: type=gha,scope=amd64
5355
cache-to: type=gha,mode=max,scope=amd64
5456
build-args: |
@@ -77,11 +79,13 @@ jobs:
7779

7880
- name: Build and push arm64
7981
uses: docker/build-push-action@v6
82+
env:
83+
REPO: ${{ github.repository }}
8084
with:
8185
context: .
8286
push: true
8387
platforms: linux/arm64
84-
tags: ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }}-arm64
88+
tags: ghcr.io/${{ env.REPO }}:${{ needs.release-please.outputs.tag_name }}-arm64
8589
cache-from: type=gha,scope=arm64
8690
cache-to: type=gha,mode=max,scope=arm64
8791
build-args: |
@@ -105,8 +109,10 @@ jobs:
105109

106110
- name: Create and push multi-platform manifest
107111
run: |
112+
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
113+
TAG="${{ needs.release-please.outputs.tag_name }}"
108114
docker buildx imagetools create \
109-
--tag ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }} \
110-
--tag ghcr.io/${{ github.repository }}:latest \
111-
ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }}-amd64 \
112-
ghcr.io/${{ github.repository }}:${{ needs.release-please.outputs.tag_name }}-arm64
115+
--tag ghcr.io/${REPO}:${TAG} \
116+
--tag ghcr.io/${REPO}:latest \
117+
ghcr.io/${REPO}:${TAG}-amd64 \
118+
ghcr.io/${REPO}:${TAG}-arm64

0 commit comments

Comments
 (0)