Test quay.io push #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Push binaries to Quay.io, when a new release is created | |
| name: oadp-cli binaries image push | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| env: | |
| IMAGE_REPO: quay.io/rh_ee_jvaikath/oadp-cli-binaries | |
| # Check out code, podman login, run podman build, push to | |
| jobs: | |
| multi-arch-build: | |
| name: Build Multi-Arch Images | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64, ppc64le, s390x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Build Image for ${{ matrix.arch }} | |
| id: build_image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: oadp-cli-binaries-local | |
| tags: ${{ matrix.arch }} | |
| archs: ${{ matrix.arch }} | |
| containerfiles: | | |
| ./Containerfile.download | |
| - name: Save image as tar | |
| run: | | |
| buildah push ${{ steps.build_image.outputs.image-with-tag }} oci-archive:oadp-cli-${{ matrix.arch }}.tar | |
| - name: Upload image artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: oadp-cli-image-${{ matrix.arch }} | |
| path: oadp-cli-${{ matrix.arch }}.tar | |
| retention-days: 1 | |
| push-manifest: | |
| name: Create and Push Multi-Arch Manifest | |
| runs-on: ubuntu-latest | |
| needs: multi-arch-build | |
| if: startsWith(github.ref_name, 'v') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: oadp-cli-image-* | |
| - name: Load images and create manifest | |
| run: | | |
| # Load all arch images | |
| buildah pull oci-archive:oadp-cli-image-amd64/oadp-cli-amd64.tar | |
| buildah pull oci-archive:oadp-cli-image-arm64/oadp-cli-arm64.tar | |
| buildah pull oci-archive:oadp-cli-image-ppc64le/oadp-cli-ppc64le.tar | |
| buildah pull oci-archive:oadp-cli-image-s390x/oadp-cli-s390x.tar | |
| # Tag them for manifest | |
| buildah tag localhost/oadp-cli-binaries-local:amd64 ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 | |
| buildah tag localhost/oadp-cli-binaries-local:arm64 ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 | |
| buildah tag localhost/oadp-cli-binaries-local:ppc64le ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le | |
| buildah tag localhost/oadp-cli-binaries-local:s390x ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x | |
| - name: Buildah login | |
| run: buildah login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io | |
| - name: Create and push version manifest | |
| run: | | |
| buildah manifest create ${{ env.IMAGE_REPO }}:${{ github.ref_name }} | |
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 | |
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 | |
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le | |
| buildah manifest add ${{ env.IMAGE_REPO }}:${{ github.ref_name }} ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x | |
| buildah manifest push --all ${{ env.IMAGE_REPO }}:${{ github.ref_name }} | |
| - name: Create and push latest manifest | |
| run: | | |
| buildah manifest create ${{ env.IMAGE_REPO }}:latest | |
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-amd64 | |
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-arm64 | |
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-ppc64le | |
| buildah manifest add ${{ env.IMAGE_REPO }}:latest ${{ env.IMAGE_REPO }}:${{ github.ref_name }}-s390x | |
| buildah manifest push --all ${{ env.IMAGE_REPO }}:latest |