Skip to content

Commit cb685ba

Browse files
committed
fix: mirroring the merged manifest instead of per arch image
1 parent e862161 commit cb685ba

File tree

2 files changed

+24
-42
lines changed

2 files changed

+24
-42
lines changed

.github/workflows/dockerhub-release-matrix.yml

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -155,43 +155,32 @@ jobs:
155155
supabase/postgres:${{ steps.get_version.outputs.pg_version }}_amd64 \
156156
supabase/postgres:${{ steps.get_version.outputs.pg_version }}_arm64
157157
get_publish_version:
158-
needs: [prepare, merge_manifest]
159-
runs-on: ubuntu-latest
160-
outputs:
161-
matrix: ${{ steps.get_versions.outputs.matrix }}
162-
steps:
163-
- uses: actions/checkout@v3
164-
- uses: DeterminateSystems/nix-installer-action@main
165-
- name: Get version
166-
id: get_versions
167-
run: |
168-
nix run nixpkgs#nushell -- -c '
169-
let original_matrix = ${{ needs.prepare.outputs.matrix_config }}
170-
let versions = $original_matrix.include
171-
let processed_versions = ($versions | each { |item|
172-
let version = $item.version
173-
let release_key = if ($version | str contains "orioledb") {
174-
$"postgresorioledb-17"
175-
} else {
176-
$"postgres($version)"
158+
needs: merge_manifest
159+
runs-on: ubuntu-latest
160+
outputs:
161+
versions: ${{ steps.get_versions.outputs.versions }}
162+
steps:
163+
- uses: docker/setup-buildx-action@v3
164+
- uses: docker/login-action@v2
165+
with:
166+
username: ${{ secrets.DOCKER_USERNAME }}
167+
password: ${{ secrets.DOCKER_PASSWORD }}
168+
- uses: DeterminateSystems/nix-installer-action@main
169+
- name: Get merged manifest versions
170+
id: get_versions
171+
run: |
172+
nix run nixpkgs#nushell -- -c '
173+
let manifest = (docker manifest inspect supabase/postgres | from json)
174+
let tags = {
175+
include: [$manifest.tag]
177176
}
178-
let pg_version = (open ansible/vars.yml | get postgres_release | get $release_key | str trim)
179-
180-
# Include both AMD64 and ARM64 architectures
181-
[{version: $pg_version, arch: "amd64"}, {version: $pg_version, arch: "arm64"}]
182-
} | flatten)
183-
184-
let matrix = {include: $processed_versions}
185-
let matrix_json = ($matrix | to json -r)
186-
$"matrix=($matrix_json)" | save --append $env.GITHUB_OUTPUT
187-
'
188-
177+
$"versions=($tags | to json -r)" | save --append $env.GITHUB_OUTPUT
178+
'
189179
publish:
190180
needs: get_publish_version
191181
strategy:
192-
matrix: ${{ fromJson(needs.get_publish_version.outputs.matrix) }}
182+
matrix: ${{ fromJson(needs.get_publish_version.outputs.versions) }}
193183
uses: ./.github/workflows/mirror.yml
194184
with:
195185
version: ${{ matrix.version }}
196-
arch: ${{ matrix.arch }}
197186
secrets: inherit

.github/workflows/mirror.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,12 @@ on:
66
version:
77
required: true
88
type: string
9-
arch:
10-
required: true
11-
type: string
129
workflow_dispatch:
1310
inputs:
1411
version:
1512
description: "Image tag"
1613
required: true
1714
type: string
18-
arch:
19-
description: "Architecture"
20-
required: true
21-
type: string
2215

2316
jobs:
2417
mirror:
@@ -43,7 +36,7 @@ jobs:
4336
password: ${{ secrets.GITHUB_TOKEN }}
4437
- uses: akhilerm/[email protected]
4538
with:
46-
src: docker.io/supabase/postgres:${{ inputs.version }}_${{ inputs.arch }}
39+
src: docker.io/supabase/postgres:${{ inputs.version }}
4740
dst: |
48-
public.ecr.aws/supabase/postgres:${{ inputs.version }}_${{ inputs.arch }}
49-
ghcr.io/supabase/postgres:${{ inputs.version }}_${{ inputs.arch }}
41+
public.ecr.aws/supabase/postgres:${{ inputs.version }}
42+
ghcr.io/supabase/postgres:${{ inputs.version }}

0 commit comments

Comments
 (0)