|
| 1 | +name: publish-15 |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + publish-15: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - |
| 13 | + name: Checkout code |
| 14 | + uses: actions/checkout@v3 |
| 15 | + - |
| 16 | + name: Get repository name |
| 17 | + run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV |
| 18 | + shell: bash |
| 19 | + - |
| 20 | + name: Read PostgreSQL version - minor |
| 21 | + uses: bfren/read-file@v2 |
| 22 | + with: |
| 23 | + file: ./15/overlay/tmp/POSTGRESQL_MINOR |
| 24 | + id: postgresql_minor |
| 25 | + - |
| 26 | + name: Read image version |
| 27 | + uses: bfren/read-file@v2 |
| 28 | + with: |
| 29 | + file: ./VERSION_MAJOR |
| 30 | + id: version_major |
| 31 | + - |
| 32 | + name: Read image version |
| 33 | + uses: bfren/read-file@v2 |
| 34 | + with: |
| 35 | + file: ./VERSION_MINOR |
| 36 | + id: version_minor |
| 37 | + - |
| 38 | + name: Read image version |
| 39 | + uses: bfren/read-file@v2 |
| 40 | + with: |
| 41 | + file: ./VERSION |
| 42 | + id: version |
| 43 | + - |
| 44 | + name: Set up QEMU |
| 45 | + uses: docker/setup-qemu-action@v2 |
| 46 | + - |
| 47 | + name: Set up Docker Buildx |
| 48 | + uses: docker/setup-buildx-action@v2 |
| 49 | + - |
| 50 | + name: Login to DockerHub |
| 51 | + uses: docker/login-action@v2 |
| 52 | + with: |
| 53 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 54 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 55 | + - |
| 56 | + name: Login to GitHub Container Registry |
| 57 | + uses: docker/login-action@v2 |
| 58 | + with: |
| 59 | + registry: ghcr.io |
| 60 | + username: ${{ github.repository_owner }} |
| 61 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + - |
| 63 | + name: Build and push |
| 64 | + id: docker_build |
| 65 | + uses: docker/build-push-action@v3 |
| 66 | + with: |
| 67 | + context: . |
| 68 | + file: ./15/Dockerfile |
| 69 | + build-args: | |
| 70 | + BF_IMAGE=${{ env.REPOSITORY_NAME }} |
| 71 | + BF_VERSION=${{ steps.version.outputs.contents }} |
| 72 | + push: true |
| 73 | + platforms: linux/amd64,linux/arm/v7,linux/arm64 |
| 74 | + tags: | |
| 75 | + bfren/postgresql:postgresql15 |
| 76 | + bfren/postgresql:postgresql15-${{ steps.version_major.outputs.contents }} |
| 77 | + bfren/postgresql:postgresql15-${{ steps.version_minor.outputs.contents }} |
| 78 | + bfren/postgresql:postgresql15-${{ steps.version.outputs.contents }} |
| 79 | + bfren/postgresql:postgresql${{ steps.postgresql_minor.outputs.contents }} |
| 80 | + bfren/postgresql:postgresql${{ steps.postgresql_minor.outputs.contents }}-${{ steps.version.outputs.contents }} |
| 81 | + ghcr.io/bfren/postgresql:postgresql15 |
| 82 | + ghcr.io/bfren/postgresql:postgresql15-${{ steps.version_major.outputs.contents }} |
| 83 | + ghcr.io/bfren/postgresql:postgresql15-${{ steps.version_minor.outputs.contents }} |
| 84 | + ghcr.io/bfren/postgresql:postgresql15-${{ steps.version.outputs.contents }} |
| 85 | + ghcr.io/bfren/postgresql:postgresql${{ steps.postgresql_minor.outputs.contents }} |
| 86 | + ghcr.io/bfren/postgresql:postgresql${{ steps.postgresql_minor.outputs.contents }}-${{ steps.version.outputs.contents }} |
| 87 | + - |
| 88 | + name: Image digest |
| 89 | + run: echo ${{ steps.docker_build.outputs.digest }} |
0 commit comments