From c3e41dab99a7263e11787117d9f7995469ccf349 Mon Sep 17 00:00:00 2001 From: Maniteja0126 Date: Wed, 12 Jun 2024 22:57:43 +0530 Subject: [PATCH 1/2] ci: Add metadata tags for Docker image publishing --- .github/workflows/publish-docker.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index a4a8a4c5f..637cfd633 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -17,9 +17,25 @@ jobs: with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=sha + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + type=semver,pattern={{version}} + type=raw,value={{date 'YYYYMMDD'}} + - name: Build and push uses: docker/build-push-action@v3 with: context: . push: true - tags: excalidraw/excalidraw:latest + tags: | + ${{ steps.meta.outputs.tags }} + excalidraw/excalidraw:latest From 8609cbe9d62eaaf42c623e0ef3a7fcec16789381 Mon Sep 17 00:00:00 2001 From: Maniteja0126 Date: Fri, 21 Jun 2024 11:32:04 +0530 Subject: [PATCH 2/2] fix : linting and formatting issues --- .github/workflows/publish-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 637cfd633..9b8516da1 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -8,10 +8,10 @@ on: jobs: publish-docker: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Login to DockerHub uses: docker/login-action@v2 with: @@ -30,7 +30,7 @@ jobs: type=ref,event=tag type=semver,pattern={{version}} type=raw,value={{date 'YYYYMMDD'}} - + - name: Build and push uses: docker/build-push-action@v3 with: