From 14b1b8d5dc32d1adfabc2f0e397e889024a1315a Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Tue, 7 Jun 2022 01:52:06 +0800 Subject: [PATCH] fix ci --- .github/workflows/main.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27acbe8..bbaa791 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,6 +78,7 @@ jobs: uses: codecov/codecov-action@v3 with: env_vars: OS,PYTHON_VERSION + docker-main: name: Docker main runs-on: ubuntu-latest @@ -104,13 +105,17 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Git Branch Name + id: git-branch-name + uses: EthanSK/git-branch-name-action@v1 + - name: Build and push uses: docker/build-push-action@v2 with: context: . file: ./docker/Dockerfile_with_frontend - push: ${{ github.event_name != 'pull_request' }} - tags: felinae98/nonebot-bison:${{ env.GITHUB_REF_NAME }} + push: true + tags: felinae98/nonebot-bison:${{ env.GIT_BRANCH_NAME }} cache-from: type=gha cache-to: type=gha,mode=max @@ -134,6 +139,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Git Branch Name + id: git-branch-name + uses: EthanSK/git-branch-name-action@v1 + - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 @@ -147,6 +156,6 @@ jobs: context: . file: ./docker/Dockerfile_with_frontend_sentry push: ${{ github.event_name != 'pull_request' }} - tags: felinae98/nonebot-bison:${{ env.GITHUB_REF_NAME }}-sentry + tags: felinae98/nonebot-bison:${{ env.GIT_BRANCH_NAME }}-sentry cache-from: type=gha cache-to: type=gha,mode=max