diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index c69a4d3..d4b1bb5 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -3,6 +3,8 @@ name: build_docker on: push: branches: [main] + release: + types: [created] # 表示在创建新的 Release 时触发 jobs: build_docker: @@ -11,11 +13,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: chenzhaoyu94/chatgpt-web + + - run: | + echo "本次构建的版本为:${GITHUB_REF_NAME} (但是这个变量目前上下文中无法获取到)" + echo 本次构建的版本为:${{ github.ref_name }} + env - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -32,6 +34,8 @@ jobs: with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-web:${{ github.ref_name }} + ${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-web:latest diff --git a/README.md b/README.md index 6fb48c6..625c661 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ version: '3' services: app: - image: chenzhaoyu94/chatgpt-web:main + image: chenzhaoyu94/chatgpt-web # 总是使用latest,更新时重新pull该tag镜像即可 ports: - 3002:3002 environment: