Created
November 17, 2022 22:33
-
-
Save robalb/9184f5eb86109845f8b419912d188160 to your computer and use it in GitHub Desktop.
tag image in github action
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: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# https://github.com/docker/metadata-action#typesha | |
tags: | | |
type=sha,priority=100,format=short,prefix=sha- | |
type=raw,priority=200,prefix=sha-,value=${{ github.sha }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment