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