Skip to content

Commit

Permalink
🤞
Browse files Browse the repository at this point in the history
  • Loading branch information
soedirgo committed Jan 25, 2024
1 parent e2064ac commit 72f26aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/ami-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,24 @@ jobs:
endpoint: builders
- uses: docker/build-push-action@v5
with:
load: true
build-args: |
${{ steps.args.outputs.result }}
target: extensions
tags: supabase/postgres:extensions
platforms: linux/${{ matrix.arch }}
outputs: type=tar,dest=/tmp/extensions.tar
cache-from: type=gha,scope=${{ github.ref_name }}-latest-${{ matrix.arch }}
# No need to export extensions cache because latest depends on it
- name: Extract built packages
run: |
mkdir -p /tmp/extensions ansible/files/extensions
docker save supabase/postgres:extensions | tar xv -C /tmp/extensions
for layer in /tmp/extensions/*/layer.tar; do
tar xvf "$layer" -C ansible/files/extensions --strip-components 1
done
mkdir -p ansible/files/extensions
tar xvf /tmp/extensions.tar -C ansible/files/extensions --strip-components 1
- id: version
run: echo "${{ steps.args.outputs.result }}" | grep "postgresql" >> "$GITHUB_OUTPUT"
- name: Build Postgres deb
uses: docker/build-push-action@v5
with:
load: true
file: docker/Dockerfile
target: pg-deb
build-args: |
Expand All @@ -82,15 +78,13 @@ jobs:
CPPFLAGS=-mcpu=${{ matrix.mcpu }}
tags: supabase/postgres:deb
platforms: linux/${{ matrix.arch }}
outputs: type=tar,dest=/tmp/pg-deb.tar
cache-from: type=gha,scope=${{ github.ref_name }}-deb
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-deb
- name: Extract Postgres deb
run: |
mkdir -p /tmp/build ansible/files/postgres
docker save supabase/postgres:deb | tar xv -C /tmp/build
for layer in /tmp/build/*/layer.tar; do
tar xvf "$layer" -C ansible/files/postgres --strip-components 1
done
mkdir -p ansible/files/postgres
tar xvf /tmp/pg-deb.tar -C ansible/files/postgres --strip-components 1
- name: Build AMI
run: |
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/testinfra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ jobs:

- uses: docker/build-push-action@v5
with:
load: true
build-args: |
${{ steps.args.outputs.result }}
target: extensions
tags: supabase/postgres:extensions
platforms: linux/${{ matrix.arch }}
outputs: type=tar,dest=/tmp/extensions.tar
cache-from: |
type=gha,scope=${{ github.ref_name }}-extensions
type=gha,scope=${{ github.base_ref }}-extensions
Expand All @@ -86,19 +86,15 @@ jobs:

- name: Extract built packages
run: |
mkdir -p /tmp/extensions ansible/files/extensions
docker save supabase/postgres:extensions | tar xv -C /tmp/extensions
for layer in /tmp/extensions/*/layer.tar; do
tar xvf "$layer" -C ansible/files/extensions --strip-components 1
done
mkdir -p ansible/files/extensions
tar xvf /tmp/extensions.tar -C ansible/files/extensions --strip-components 1
- id: version
run: echo "${{ steps.args.outputs.result }}" | grep "postgresql" >> "$GITHUB_OUTPUT"

- name: Build Postgres deb
uses: docker/build-push-action@v5
with:
load: true
file: docker/Dockerfile
target: pg-deb
build-args: |
Expand All @@ -109,6 +105,7 @@ jobs:
CPPFLAGS=-mcpu=${{ matrix.mcpu }}
tags: supabase/postgres:deb
platforms: linux/${{ matrix.arch }}
outputs: type=tar,dest=/tmp/pg-deb.tar
cache-from: |
type=gha,scope=${{ github.ref_name }}-deb
type=gha,scope=${{ github.base_ref }}-deb
Expand All @@ -117,11 +114,8 @@ jobs:

- name: Extract Postgres deb
run: |
mkdir -p /tmp/build ansible/files/postgres
docker save supabase/postgres:deb | tar xv -C /tmp/build
for layer in /tmp/build/*/layer.tar; do
tar xvf "$layer" -C ansible/files/postgres --strip-components 1
done
mkdir -p ansible/files/postgres
tar xvf /tmp/pg-deb.tar -C ansible/files/postgres --strip-components 1
# Packer doesn't support skipping registering the AMI for the ebssurrogate
# builder, so we register an AMI with a fixed name and run tests on an
Expand Down

0 comments on commit 72f26aa

Please sign in to comment.