Skip to content

Commit

Permalink
Attempt to tag images better
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Sep 25, 2024
1 parent 8c3aa08 commit b3697a0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
- name: Docker meta
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images:
metno/sedr
ghcr.io/metno/sedr
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
Expand All @@ -57,11 +59,11 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Retag and push Docker image with additional tags
run: |
docker pull ${{ steps.meta.outputs.tags }}
docker tag ${{ steps.meta.outputs.tags }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
# - name: Retag and push Docker image with additional tags
# run: |
# docker pull ${{ steps.meta.outputs.tags }}
# docker tag ${{ steps.meta.outputs.tags }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
# docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
Expand Down

0 comments on commit b3697a0

Please sign in to comment.