diff --git a/.github/workflows/ttc.yml b/.github/workflows/ttc.yml index e4937da4..fcaa2cfd 100644 --- a/.github/workflows/ttc.yml +++ b/.github/workflows/ttc.yml @@ -8,9 +8,6 @@ on: - main tags: - v* - pull_request: - branches: - - main paths: - 'core/**' - 'driver/**' @@ -23,10 +20,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v3 @@ -35,13 +32,23 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set Docker tag - run: echo "DOCKER_TAG=${{ startsWith(github.ref, 'refs/tags/') && github.ref[10:] || 'latest' }}" >> $GITHUB_ENV + shell: bash + run: | + ref_v="${{ github.ref }}" + if [[ $ref_v == refs/tags/* ]]; then + DOCKER_TAG=${ref_v:10} + else + DOCKER_TAG="latest" + fi + echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV - name: Print Docker tag - run: echo "Start to build and publish: datafuselabs/ttc-rust:$DOCKER_TAG" + shell: bash + run: | + echo "Start to build and publish: datafuselabs/ttc-rust:$DOCKER_TAG" - name: TTC Build and push - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v6 with: push: true file: ./ttc/Dockerfile