diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index faa8574b39..2efb5c3e96 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -62,19 +62,19 @@ jobs: username: ${{ secrets.ALI_DOCKER_USERNAME }} password: ${{ secrets.ALI_DOCKER_PASSWORD }} - - name: Login to Aliyun Container Registry (Public) - uses: docker/login-action@v2 - with: - registry: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }} - username: ${{ secrets.ALI_DOCKER_USERNAME }} - password: ${{ secrets.ALI_DOCKER_PASSWORD }} - - - name: Login to Docker Hub - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + # - name: Login to Aliyun Container Registry (Public) + # uses: docker/login-action@v2 + # with: + # registry: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }} + # username: ${{ secrets.ALI_DOCKER_USERNAME }} + # password: ${{ secrets.ALI_DOCKER_PASSWORD }} + # + # - name: Login to Docker Hub + # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' + # uses: docker/login-action@v2 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set tags id: set-tags diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be0f700424..5506e2ae37 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -115,9 +115,9 @@ jobs: shell: bash run: | if [[ "${{ github.ref_name }}" =~ "beta" ]]; then - echo "defaultTag=$(echo 'latest')" >> $GITHUB_OUTPUT + echo "branch=$(echo 'main')" >> $GITHUB_OUTPUT else - echo "defaultTag=$(echo 'next')" >> $GITHUB_OUTPUT + echo "branch=$(echo 'next')" >> $GITHUB_OUTPUT fi - name: Checkout uses: actions/checkout@v3 @@ -147,10 +147,19 @@ jobs: registry: ${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }} username: ${{ secrets.ALI_DOCKER_USERNAME }} password: ${{ secrets.ALI_DOCKER_PASSWORD }} - - name: Build and push + - name: Build and push main + if: ${{ steps.get-info.outputs.branch == 'main' }} uses: docker/build-push-action@v3 with: context: ./docker/nocobase platforms: linux/amd64,linux/arm64 push: true - tags: nocobase/nocobase:${{ steps.get-info.outputs.defaultTag }},${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:${{ steps.get-info.outputs.defaultTag }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }} + tags: nocobase/nocobase:main,nocobase/nocobase:latest,${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:main,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:latest,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }} + - name: Build and push next + if: ${{ steps.get-info.outputs.branch == 'next' }} + uses: docker/build-push-action@v3 + with: + context: ./docker/nocobase + platforms: linux/amd64,linux/arm64 + push: true + tags: nocobase/nocobase:next,${{ steps.meta.outputs.tags }},${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/nocobase/nocobase:next,${{ secrets.ALI_DOCKER_PUBLIC_REGISTRY }}/${{ steps.meta.outputs.tags }}