Merge pull request #3885 from opendatahub-io/lockfile-update-20260622… #10
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
| --- | |
| name: Build Browser Tests Image | |
| "on": | |
| workflow_dispatch: | |
| inputs: | |
| push_image: | |
| description: 'Push image to registry' | |
| type: boolean | |
| default: false | |
| pull_request: | |
| paths: | |
| - 'tests/browser/**' | |
| - '.github/workflows/build-browser-tests.yaml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'tests/browser/**' | |
| - '.github/workflows/build-browser-tests.yaml' | |
| env: | |
| IMAGE_REGISTRY: quay.io | |
| IMAGE_NAME: opendatahub/workbench-images-tests | |
| CONTEXT: tests/browser | |
| # packages: write is only needed for ghcr.io, not for quay.io | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.arch }}) | |
| runs-on: ${{ fromJSON('{"amd64":"ubuntu-24.04","arm64":"ubuntu-24.04-arm"}')[matrix.arch] }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [amd64, arm64] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Build container image | |
| id: build | |
| run: | | |
| podman build \ | |
| -t "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest-${{ matrix.arch }}" \ | |
| -f "${CONTEXT}/Dockerfile" \ | |
| "${CONTEXT}" | |
| - name: Smoke-test the image (list tests) | |
| run: | | |
| podman run --rm \ | |
| "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest-${{ matrix.arch }}" \ | |
| --list --project=chromium | |
| - name: Login to Quay.io | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.push_image == true | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | |
| with: | |
| registry: ${{ env.IMAGE_REGISTRY }} | |
| username: ${{ secrets.QUAY_ROBOT_USERNAME }} | |
| password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
| - name: Push arch image | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.push_image == true | |
| run: | | |
| podman push "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest-${{ matrix.arch }}" | |
| manifest: | |
| name: Create and push multiarch manifest | |
| runs-on: ubuntu-24.04 | |
| needs: build | |
| if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.push_image == true | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Login to Quay.io | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 | |
| with: | |
| registry: ${{ env.IMAGE_REGISTRY }} | |
| username: ${{ secrets.QUAY_ROBOT_USERNAME }} | |
| password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
| - name: Create and push manifest | |
| run: | | |
| podman manifest create "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest" | |
| podman manifest add "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest" \ | |
| "docker://${IMAGE_REGISTRY}/${IMAGE_NAME}:latest-amd64" | |
| podman manifest add "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest" \ | |
| "docker://${IMAGE_REGISTRY}/${IMAGE_NAME}:latest-arm64" | |
| podman manifest push "${IMAGE_REGISTRY}/${IMAGE_NAME}:latest" \ | |
| "docker://${IMAGE_REGISTRY}/${IMAGE_NAME}:latest" --all |