Skip to content

Commit 2a2d157

Browse files
authored
test: use postgres release version for docker tag (#1099)
* test: use postgres release version for docker tag * fix: ref the var correct * fix: use correct Dockerfile --------- Co-authored-by: Sam Rose <[email protected]>
1 parent 5c8032c commit 2a2d157

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
POSTGRES_PASSWORD: password
2424
steps:
2525
- uses: actions/checkout@v3
26+
- id: settings
27+
# Remove spaces and quotes to get the raw version string
28+
run: sed -r 's/(\s|\")+//g' common-nix.vars.pkr.hcl >> $GITHUB_OUTPUT
29+
2630
- id: args
2731
uses: mikefarah/yq@master
2832
with:
@@ -36,23 +40,23 @@ jobs:
3640
with:
3741
load: true
3842
context: .
43+
file: "Dockerfile-156"
3944
target: production
4045
build-args: |
4146
${{ steps.args.outputs.result }}
42-
tags: supabase/postgres:latest
47+
tags: supabase/postgres:${{ steps.settings.outputs.postgres-version }}
4348
cache-from: |
44-
type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
45-
type=gha,scope=${{ github.base_ref }}-latest-${{ matrix.arch }}
46-
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
49+
type=gha,scope=${{ github.ref_name }}-${{ steps.settings.outputs.postgres-version }}-${{ matrix.arch }}
50+
type=gha,scope=${{ github.base_ref }}-${{ steps.settings.outputs.postgres-version }}-${{ matrix.arch }}
51+
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-${{ steps.settings.outputs.postgres-version }}-${{ matrix.arch }}
4752

4853
- name: Start Postgres
4954
run: |
5055
docker run --rm --pull=never \
5156
-e POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }} \
5257
-p ${{ env.POSTGRES_PORT }}:5432 \
5358
--name supabase_postgres \
54-
-d supabase/postgres:latest
55-
59+
-d supabase/postgres:${{ steps.settings.outputs.postgres-version }}
5660
- name: Install psql
5761
run: |
5862
sudo apt update

0 commit comments

Comments
 (0)