diff --git a/.github/workflows/docker-build-amd.yml b/.github/workflows/docker-build-amd.yml index 1992e3aae..d1a61cf0d 100644 --- a/.github/workflows/docker-build-amd.yml +++ b/.github/workflows/docker-build-amd.yml @@ -26,12 +26,20 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest-rocm,enable={{is_default_branch}} + type=sha,prefix=,suffix=-rocm + type=semver,pattern={{version}},suffix=-rocm - name: Build and push ROCm (AMD) image uses: docker/build-push-action@v6 with: context: . file: ./amd.Dockerfile push: true - tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-rocm - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-rocm \ No newline at end of file + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 038ec3024..af8e27a76 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -31,14 +31,23 @@ jobs: registry: nvcr.io username: "$oauthtoken" password: ${{ secrets.NVCR_NGC_TOKEN }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=latest,enable={{is_default_branch}} + type=raw,value=latest-cuda,enable={{is_default_branch}} + type=sha,prefix= + type=sha,prefix=,suffix=-cuda + type=semver,pattern={{version}} + type=semver,pattern={{version}},suffix=-cuda - name: Build and push CUDA (NVIDIA) image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile push: true - tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest-cuda - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}-cuda + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file