|
31 | 31 | contents: read |
32 | 32 | packages: write |
33 | 33 | outputs: |
34 | | - pg_image: ${{ env.TAG }} |
| 34 | + pg_image: ${{ env.PG_IMAGE }} |
35 | 35 | pg_major: ${{ env.PG_MAJOR }} |
36 | 36 | cnpg_branch: ${{ env.CNPG_BRANCH }} |
37 | 37 | test_depth: ${{ env.TEST_DEPTH }} |
@@ -59,26 +59,33 @@ jobs: |
59 | 59 | echo "FEATURE_TYPE=${{ github.event.inputs.feature_type }}" >> $GITHUB_ENV |
60 | 60 | fi |
61 | 61 |
|
62 | | - - name: Set tag |
63 | | - run: | |
64 | | - postgres_img="${{ env.REGISTRY }}:${{ env.PG_MAJOR }}-devel" |
65 | | - echo "TAG=${postgres_img}" >> $GITHUB_ENV |
66 | | -
|
67 | 62 | - name: Log in to the GitHub Container registry |
68 | 63 | uses: docker/login-action@v3 |
69 | 64 | with: |
70 | 65 | registry: ghcr.io |
71 | 66 | username: ${{ github.actor }} |
72 | 67 | password: ${{ secrets.GITHUB_TOKEN }} |
73 | 68 |
|
74 | | - - name: Build and load |
75 | | - uses: docker/build-push-action@v6 |
| 69 | + - name: Set up Docker Buildx |
| 70 | + uses: docker/setup-buildx-action@v3 |
| 71 | + |
| 72 | + - name: Build and push |
| 73 | + uses: docker/bake-action@v6 |
| 74 | + id: build |
| 75 | + env: |
| 76 | + environment: production |
| 77 | + registry: ghcr.io/${{ github.repository_owner }} |
| 78 | + revision: ${{ github.sha }} |
| 79 | + pgMajor: ${{ env.PG_MAJOR }} |
76 | 80 | with: |
77 | | - context: . |
78 | 81 | push: true |
79 | | - load: false |
80 | | - tags: | |
81 | | - ${{ env.TAG }} |
| 82 | + |
| 83 | + # Get a list of the images that were built and pushed. We only care about a single tag for each image. |
| 84 | + - name: Generated images |
| 85 | + id: images |
| 86 | + run: | |
| 87 | + echo '${{ steps.build.outputs.metadata }}' | jq -c '[ .[]."image.name" |
| 88 | + echo "PG_IMAGE=$(echo '${{ steps.build.outputs.metadata }}' | jq -c '[ .[]."image.name" | sub(",.*";"") ]')" >> "$GITHUB_ENV" |
82 | 89 |
|
83 | 90 | call-reusable-e2e: |
84 | 91 | if: github.event_name == 'schedule' |
|
0 commit comments