Skip to content

Commit 3278b91

Browse files
committed
Use Zstd compression for published images to reduce their size and speedup decompression
1 parent be9a800 commit 3278b91

File tree

2 files changed

+46
-12
lines changed

2 files changed

+46
-12
lines changed

.github/workflows/addon-deploy.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,30 @@ jobs:
171171
rm -rf /tmp/.docker-cache
172172
mv /tmp/.docker-cache-new /tmp/.docker-cache
173173
- name: 🚀 Push
174-
# yamllint disable rule:line-length
175-
run: |
176-
docker push \
177-
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}"
178-
docker push \
179-
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}"
174+
uses: docker/build-push-action@v6.18.0
175+
with:
176+
outputs: type=image,oci-mediatypes=true,compression=zstd,push=true
177+
# yamllint disable rule:line-length
178+
tags: |
179+
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
180+
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
181+
# yamllint enable rule:line-length
182+
context: ${{ needs.information.outputs.target }}
183+
file: ${{ needs.information.outputs.target }}/Dockerfile
184+
cache-from: |
185+
type=local,src=/tmp/.docker-cache
186+
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
187+
cache-to: type=local,mode=max,dest=/tmp/.docker-cache-new
188+
platforms: ${{ steps.flags.outputs.platform }}
189+
build-args: |
190+
BUILD_ARCH=${{ matrix.architecture }}
191+
BUILD_DATE=${{ steps.flags.outputs.date }}
192+
BUILD_DESCRIPTION=${{ needs.information.outputs.description }}
193+
BUILD_FROM=${{ steps.flags.outputs.from }}
194+
BUILD_NAME=${{ needs.information.outputs.name }}
195+
BUILD_REF=${{ github.sha }}
196+
BUILD_REPOSITORY=${{ github.repository }}
197+
BUILD_VERSION=${{ needs.information.outputs.version }}
180198
181199
publish-edge:
182200
name: 📢 Publish to edge repository

.github/workflows/base-deploy.yaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,28 @@ jobs:
126126
BUILD_REPOSITORY=${{ github.repository }}
127127
BUILD_VERSION=${{ needs.information.outputs.version }}
128128
- name: 🚀 Push
129-
# yamllint disable rule:line-length
130-
run: |
131-
docker push \
132-
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}"
133-
docker push \
134-
"ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}"
129+
uses: docker/build-push-action@v6.18.0
130+
with:
131+
outputs: type=image,oci-mediatypes=true,compression=zstd,push=true
132+
# yamllint disable rule:line-length
133+
tags: |
134+
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.environment }}
135+
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:${{ needs.information.outputs.version }}
136+
# yamllint enable rule:line-length
137+
context: ${{ needs.information.outputs.target }}
138+
file: ${{ needs.information.outputs.target }}/Dockerfile
139+
cache-from: |
140+
type=local,src=/tmp/.docker-cache
141+
ghcr.io/${{ github.repository_owner }}/${{ needs.information.outputs.slug }}/${{ matrix.architecture }}:edge
142+
cache-to: type=local,mode=max,dest=/tmp/.docker-cache
143+
platforms: ${{ steps.flags.outputs.platform }}
144+
build-args: |
145+
BUILD_ARCH=${{ matrix.architecture }}
146+
BUILD_DATE=${{ steps.flags.outputs.date }}
147+
BUILD_FROM=${{ steps.flags.outputs.from }}
148+
BUILD_REF=${{ github.sha }}
149+
BUILD_REPOSITORY=${{ github.repository }}
150+
BUILD_VERSION=${{ needs.information.outputs.version }}
135151
136152
manifest:
137153
name: 👷 Build & Deploy Multi Arch Manifest

0 commit comments

Comments
 (0)