From 3fcf2d972377d0b87f48f2efc9bf828251e8a996 Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Fri, 22 Oct 2021 14:20:45 -0400 Subject: [PATCH] chore(template): sync with ahmadnassri/template-node-lib --- .github/workflows/push.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index be1bf81..214406c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -131,6 +131,8 @@ jobs: outputs: published: ${{ steps.release.outputs.published }} version: ${{ steps.release.outputs.release-version }} + version-major: ${{ steps.release.outputs.release-version-major }} + version-minor: ${{ steps.release.outputs.release-version-minor }} steps: - uses: actions/checkout@v2.3.5 @@ -208,10 +210,9 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GH_TOKEN }} - - id: hub + - id: meta run: | - echo "::set-output name=name::$(basename "${GITHUB_REPOSITORY/node-//}")" - echo "::set-output name=version::${{ needs.release.outputs.version }}" + echo "::set-output name=name::${{ github.repository_owner }}/$(basename "${GITHUB_REPOSITORY/node-//}")" # publish - uses: docker/build-push-action@v2 @@ -220,14 +221,18 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache tags: | - ${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:latest - ${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:${{ steps.hub.outputs.version }} - ghcr.io/${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:latest - ghcr.io/${{ github.repository_owner }}/${{ steps.hub.outputs.name }}:${{ steps.hub.outputs.version }} + ${{ steps.meta.outputs.name }}:latest + ${{ steps.meta.outputs.name }}:v${{ needs.release.outputs.version-major }}.${{ needs.release.outputs.version-minor }} + ${{ steps.meta.outputs.name }}:v${{ needs.release.outputs.version-major }} + ${{ steps.meta.outputs.name }}:v${{ needs.release.outputs.version }} + ghcr.io/${{ steps.meta.outputs.name }}:latest + ghcr.io/${{ steps.meta.outputs.name }}:v${{ needs.release.outputs.version-major }}.${{ needs.release.outputs.version-minor }} + ghcr.io/${{ steps.meta.outputs.name }}:v${{ needs.release.outputs.version-major }} + ghcr.io/${{ steps.meta.outputs.name }}:v${{ needs.release.outputs.version }} labels: | - org.opencontainers.image.title=${{ steps.hub.outputs.name }} + org.opencontainers.image.title=${{ steps.meta.outputs.name }} org.opencontainers.image.url=${{ github.event.repository.html_url }} - org.opencontainers.image.version=${{ steps.hub.outputs.version }} + org.opencontainers.image.version=${{ needs.release.outputs.version }} org.opencontainers.image.source=${{ github.event.repository.clone_url }} org.opencontainers.image.revision=${{ github.sha }}