From 48f3da8913957460119fcc95754947a38a66b8bd Mon Sep 17 00:00:00 2001 From: songtianlun Date: Wed, 22 Jan 2025 09:19:28 +0800 Subject: [PATCH] chore: update Docker workflow for tagging - Remove unnecessary steps for version extraction - Simplify tag assignment using environment variables This update cleans up the Docker workflow by eliminating steps that were not crucial for the tagging process. The tagging is now done directly with the repository name, reducing redundancy and improving clarity in the workflow configuration. --- .github/workflows/docker.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 253b5b9..c98bdc2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,22 +14,6 @@ jobs: docker: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Get version - id: get_version - run: | - GIT_VERSION=$(git describe --dirty --always --long --abbrev=7 --tags) - VERSION="v${GIT_VERSION}" - IMAGE_PREFIX="${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}" - LATEST_TAG="${IMAGE_PREFIX}:latest" - VERSION_TAG="${IMAGE_PREFIX}:${VERSION}" - echo "VERSION=${VERSION}" >> $GITHUB_ENV - echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_ENV - echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_OUTPUT - echo "VERSION_TAG=${VERSION_TAG}" >> $GITHUB_OUTPUT - name: Login to ${{ env.REGISTRY }} if: github.event_name != 'pull_request' @@ -50,6 +34,4 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} - tags: | - ${{ env.LATEST_TAG }} - ${{ env.VERSION_TAG }} + tags: ${{ env.REGISTRY }}/${{ secrets.DOCKER_HUB_USER }}/${{ github.event.repository.name }}:latest