|
| 1 | +name: Release OrioleDB on Dockerhub |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + - orioledb |
| 8 | + paths: |
| 9 | + - ".github/workflows/dockerhub-release-orioledb.yml" |
| 10 | + - "docker/orioledb/*" |
| 11 | + - "common.vars*" |
| 12 | + |
| 13 | +jobs: |
| 14 | + settings: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + docker_version: orioledb-${{ steps.settings.outputs.postgres-version }} |
| 18 | + image_tag: supabase/postgres:orioledb-${{ steps.settings.outputs.postgres-version }} |
| 19 | + build_args: ${{ steps.args.outputs.result }} |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + - id: settings |
| 23 | + # Remove spaces and quotes to get the raw version string |
| 24 | + run: sed -r 's/(\s|\")+//g' common.vars.pkr.hcl >> $GITHUB_OUTPUT |
| 25 | + - id: args |
| 26 | + uses: mikefarah/yq@master |
| 27 | + with: |
| 28 | + cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml' |
| 29 | + |
| 30 | + build_image: |
| 31 | + needs: settings |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + include: |
| 36 | + - runner: [self-hosted, X64] |
| 37 | + arch: amd64 |
| 38 | + - runner: arm-runner |
| 39 | + arch: arm64 |
| 40 | + runs-on: ${{ matrix.runner }} |
| 41 | + timeout-minutes: 180 |
| 42 | + outputs: |
| 43 | + image_digest: ${{ steps.build.outputs.digest }} |
| 44 | + steps: |
| 45 | + - run: docker context create builders |
| 46 | + - uses: docker/setup-buildx-action@v3 |
| 47 | + with: |
| 48 | + endpoint: builders |
| 49 | + - uses: docker/login-action@v2 |
| 50 | + with: |
| 51 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 52 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 53 | + - id: build |
| 54 | + uses: docker/build-push-action@v5 |
| 55 | + with: |
| 56 | + file: docker/orioledb/Dockerfile |
| 57 | + push: true |
| 58 | + build-args: | |
| 59 | + ${{ needs.settings.outputs.build_args }} |
| 60 | + target: production |
| 61 | + tags: ${{ needs.settings.outputs.image_tag }}_${{ matrix.arch }} |
| 62 | + platforms: linux/${{ matrix.arch }} |
| 63 | + cache-from: type=gha,scope=${{ github.ref_name }}-orioledb-${{ matrix.arch }} |
| 64 | + cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-orioledb-${{ matrix.arch }} |
| 65 | + |
| 66 | + merge_manifest: |
| 67 | + needs: [settings, build_image] |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: docker/setup-buildx-action@v3 |
| 71 | + - uses: docker/login-action@v2 |
| 72 | + with: |
| 73 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 74 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 75 | + - name: Merge multi-arch manifests |
| 76 | + run: | |
| 77 | + docker buildx imagetools create -t ${{ needs.settings.outputs.image_tag }} \ |
| 78 | + ${{ needs.settings.outputs.image_tag }}_amd64 \ |
| 79 | + ${{ needs.settings.outputs.image_tag }}_arm64 |
| 80 | +
|
| 81 | + publish: |
| 82 | + needs: [settings, merge_manifest] |
| 83 | + # Call workflow explicitly because events from actions cannot trigger more actions |
| 84 | + uses: ./.github/workflows/mirror.yml |
| 85 | + with: |
| 86 | + version: ${{ needs.settings.outputs.docker_version }} |
| 87 | + secrets: inherit |
0 commit comments