Skip to content

Commit

Permalink
Push images without Alpine version
Browse files Browse the repository at this point in the history
  • Loading branch information
andyundso committed Apr 30, 2024
1 parent 809077f commit 20ff20e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
env:
# but still use our public caches in any case
# they might be outdated, in which case a full rebuild will be triggered
TARGET_TAG: ${{ github.ref == 'refs/heads/main' && 'alpine3.19' || 'dev-alpine3.19' }}
TARGET_TAG: ${{ github.ref == 'refs/heads/main' && 'alpine' || 'dev-alpine' }}
CACHE_FROM: |
type=registry,ref=pgautoupgrade/pgautoupgrade:build-9.5
type=registry,ref=pgautoupgrade/pgautoupgrade:build-9.6
Expand All @@ -68,6 +68,7 @@ jobs:
type=registry,ref=pgautoupgrade/pgautoupgrade:build-14
type=registry,ref=pgautoupgrade/pgautoupgrade:build-15
type=registry,ref=pgautoupgrade/pgautoupgrade:build-16
type=registry,ref=pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine
type=registry,ref=pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine3.19
# we cannot access TARGET_TAG from env
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
Expand Down Expand Up @@ -99,7 +100,9 @@ jobs:
uses: docker/build-push-action@v5
with:
load: true
tags: "pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine3.19"
tags: |
"pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine"
"pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine3.19"
build-args: |
"PGTARGET=${{ matrix.pg_target }}"
cache-to: type=inline
Expand All @@ -119,7 +122,9 @@ jobs:
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
tags: "pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-${{ env.TARGET_TAG }}"
tags: |
"pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine"
"pgautoupgrade/pgautoupgrade:${{ matrix.pg_target }}-alpine3.19"
push: true
cache-to: type=inline
cache-from: "${{ env.CACHE_FROM }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ To always use the latest version of PostgreSQL, use the tag
pgautoupgrade/pgautoupgrade:latest

If you instead want to run a specific version of PostgreSQL
then pick a matching tag on our Docker Hub. For example, to
then pick a matching tag on our Docker Hub. For example, to
use PostgreSQL 15 you can use:

pgautoupgrade/pgautoupgrade:15-alpine3.19
pgautoupgrade/pgautoupgrade:15-alpine

### "One shot" mode

Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_run() {
docker compose -f "docker-compose-pg${VERSION}.yml" run --rm server create_db

# Start Redash normally, using an "autoupdate" version of PostgreSQL
TARGET_TAG="${TARGET}-alpine3.19" docker compose -f docker-compose-pgauto.yml up --wait -d
TARGET_TAG="${TARGET}-alpine" docker compose -f docker-compose-pgauto.yml up --wait -d

# Verify the PostgreSQL data files are now the target version
PGVER=$(sudo cat postgres-data/PG_VERSION)
Expand Down

0 comments on commit 20ff20e

Please sign in to comment.