Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregate image digests from matrix jobs #104

Open
int128 opened this issue Apr 21, 2023 · 0 comments
Open

Aggregate image digests from matrix jobs #104

int128 opened this issue Apr 21, 2023 · 0 comments

Comments

@int128
Copy link
Owner

int128 commented Apr 21, 2023

It would be nice to aggregate the outputs of matrix jobs. It depends on actions/runner#2477.

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        platform:
          - amd64
          - arm64
    runs-on:
      - self-hosted
      - ubuntu-latest-${{ matrix.platform }}
    permissions:
      id-token: write
      contents: read
    outputs:
      image-uri-${{ matrix.platform }}: ${{ steps.ecr.outputs.registry }}/example@${{ steps.build.outputs.digest }}
    steps:
      #...
      - uses: aws-actions/amazon-ecr-login@v1
        id: ecr
      - uses: docker/build-push-action@v3
        id: build
        with:
          push: true
          tags: ${{ steps.metadata.outputs.tags }}
          labels: ${{ steps.metadata.outputs.labels }}

  build-multi-architecture:
    needs: build
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
    steps:
      #...
      - uses: int128/docker-manifest-create-action@v2
        with:
          tags: ${{ steps.metadata.outputs.tags }}
          image-uri-json: ${{ toJSON(needs.build.outputs) }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant