From 53ecc1829079424202a0aae39aac83142ada951e Mon Sep 17 00:00:00 2001 From: eryajf Date: Fri, 10 Mar 2023 18:11:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=95=9C=E5=83=8F=E7=9A=84tag=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index bc112c4..ccc699a 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -31,6 +31,10 @@ jobs: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 + - name: Get current date + id: date + run: echo "::set-output name=today::$(date +'%Y-%m-%d_%H-%M')" + - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -54,7 +58,9 @@ jobs: file: ./Dockerfile # 所需要的体系结构,可以在 Available platforms 步骤中获取所有的可用架构 platforms: linux/arm64,linux/amd64 + # 镜像推送时间 + push: ${{ github.event_name != 'pull_request' }} # 给清单打上多个标签 tags: | ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:latest - ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:${{ env.GITHUB_REF_NAME }} \ No newline at end of file + ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.GITHUB_REPOSITORY_NAME_PART }}:${{ steps.date.outputs.today }} \ No newline at end of file