|
14 | 14 | schedule: |
15 | 15 | - cron: '0 1 * * *' |
16 | 16 |
|
17 | | -# set up environment variables to be used across all the jobs |
18 | | -env: |
19 | | - REGISTRY: "ghcr.io/${{ github.repository_owner }}/postgresql-trunk" |
20 | | - |
21 | 17 | defaults: |
22 | 18 | run: |
23 | 19 | # default failure handling for shell scripts in 'run' steps |
|
31 | 27 | contents: read |
32 | 28 | packages: write |
33 | 29 | outputs: |
34 | | - pg_image: ${{ env.TAG }} |
| 30 | + pg_image: ${{ env.PG_IMAGE }} |
35 | 31 | pg_major: ${{ env.PG_MAJOR }} |
36 | 32 | cnpg_branch: ${{ env.CNPG_BRANCH }} |
37 | 33 | test_depth: ${{ env.TEST_DEPTH }} |
@@ -59,26 +55,32 @@ jobs: |
59 | 55 | echo "FEATURE_TYPE=${{ github.event.inputs.feature_type }}" >> $GITHUB_ENV |
60 | 56 | fi |
61 | 57 |
|
62 | | - - name: Set tag |
63 | | - run: | |
64 | | - postgres_img="${{ env.REGISTRY }}:${{ env.PG_MAJOR }}-devel" |
65 | | - echo "TAG=${postgres_img}" >> $GITHUB_ENV |
66 | | -
|
67 | 58 | - name: Log in to the GitHub Container registry |
68 | 59 | uses: docker/login-action@v3 |
69 | 60 | with: |
70 | 61 | registry: ghcr.io |
71 | 62 | username: ${{ github.actor }} |
72 | 63 | password: ${{ secrets.GITHUB_TOKEN }} |
73 | 64 |
|
74 | | - - name: Build and load |
75 | | - uses: docker/build-push-action@v6 |
| 65 | + - name: Set up Docker Buildx |
| 66 | + uses: docker/setup-buildx-action@v3 |
| 67 | + |
| 68 | + - name: Build and push |
| 69 | + uses: docker/bake-action@v6 |
| 70 | + id: build |
| 71 | + env: |
| 72 | + environment: production |
| 73 | + registry: ghcr.io/${{ github.repository_owner }} |
| 74 | + revision: ${{ github.sha }} |
| 75 | + pgMajor: ${{ env.PG_MAJOR }} |
76 | 76 | with: |
77 | | - context: . |
78 | 77 | push: true |
79 | | - load: false |
80 | | - tags: | |
81 | | - ${{ env.TAG }} |
| 78 | + |
| 79 | + # Get a list of the images that were built and pushed. We only care about a single tag for each image. |
| 80 | + - name: Generated images |
| 81 | + id: images |
| 82 | + run: | |
| 83 | + echo "PG_IMAGE=$(echo '${{ steps.build.outputs.metadata }}' | jq -c '.["standard"].["image.name"]' | grep -oP '[^,]*\d{12}[^,]*')" >> $GITHUB_ENV |
82 | 84 |
|
83 | 85 | call-reusable-e2e: |
84 | 86 | if: github.event_name == 'schedule' |
|
0 commit comments