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

Return image digest as action output #46

Closed
ngraef opened this issue May 21, 2020 · 5 comments
Closed

Return image digest as action output #46

ngraef opened this issue May 21, 2020 · 5 comments
Milestone

Comments

@ngraef
Copy link

ngraef commented May 21, 2020

To better support image pinning, this action should output the image digest after pushing to a registry. The digest could then be used as a parameter for a future step in the workflow, like triggering a deployment.

@EronWright
Copy link

Here's a workaround to use in combination with the tag_with_sha option. Simply put, compute the git short SHA and use it.

      - name: Get Git Short SHA
        id: slug
        run: echo "::set-output name=sha7::$(echo ${{ github.sha }} | cut -c1-7)"

      - name: Publish Docker Image
        uses: docker/build-push-action@v1
        with:
          repository: myorg/myrepository
          tag_with_sha: true

      - name: Use Docker Image (Example)
        run: docker pull "myorg/myrepository:sha-${{ steps.slug.outputs.sha7 }}"

@crazy-max
Copy link
Member

crazy-max commented Sep 2, 2020

This will be available through build-push-action v2 (#92).
You can already try it by combining it with:

@crazy-max crazy-max added this to the v2 milestone Sep 2, 2020
@meekrosoft
Copy link

Fantastic news, looking forward to this landing!

@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

And it should fix this current issue. Don't hesitate if you have any questions.

@meekrosoft
Copy link

Brilliant, many thanks!

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

4 participants