diff --git a/.github/workflows/release-image-api.yml b/.github/workflows/release-image-api.yml new file mode 100644 index 00000000000000..2dcc71e450bfc2 --- /dev/null +++ b/.github/workflows/release-image-api.yml @@ -0,0 +1,69 @@ +name: Build and Push Dify API Docker Image (Separate AMD64 & ARM64 tags) + +on: + workflow_dispatch: + inputs: + tag: + description: 'The tag to release' + required: true + push: + branches: [release-ci] + pull_request: + types: [closed] + branches: [release-ci] + +concurrency: + group: build-push-${{ github.run_id }} + cancel-in-progress: true + +env: + REGISTRY_HOST: registry.cn-hangzhou.aliyuncs.com + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + IMAGE_BASE: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-api + +jobs: + build-api: + runs-on: ubuntu-latest + steps: + - name: Checkout + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@v2 + + - name: Login to Aliyun Registry + if: github.event_name == 'workflow_dispatch' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_HOST }} + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + if: github.event_name == 'workflow_dispatch' + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + if: github.event_name == 'workflow_dispatch' + uses: docker/setup-buildx-action@v3 + + - name: Build & push AMD64 image + if: github.event_name == 'workflow_dispatch' + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:api" + platforms: linux/amd64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }} + cache-from: type=gha,scope=dify-api-amd64 + cache-to: type=gha,mode=max,scope=dify-api-amd64 + + - name: Build & push ARM64 image + if: github.event_name == 'workflow_dispatch' + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:api" + platforms: linux/arm64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }}-arm64 + cache-from: type=gha,scope=dify-api-arm64 + cache-to: type=gha,mode=max,scope=dify-api-arm64 \ No newline at end of file diff --git a/.github/workflows/release-image-web.yml b/.github/workflows/release-image-web.yml new file mode 100644 index 00000000000000..80eedfe4d27479 --- /dev/null +++ b/.github/workflows/release-image-web.yml @@ -0,0 +1,69 @@ +name: Build and Push Dify Web Docker Image (Separate AMD64 & ARM64 tags) + +on: + workflow_dispatch: + inputs: + tag: + description: 'The tag to release' + required: true + push: + branches: [release-ci] + pull_request: + types: [closed] + branches: [release-ci] + +concurrency: + group: build-push-${{ github.run_id }} + cancel-in-progress: true + +env: + REGISTRY_HOST: registry.cn-hangzhou.aliyuncs.com + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + IMAGE_BASE: ${{ env.REGISTRY_HOST }}/kindlingx/apo-dify-web + +jobs: + build-web: + runs-on: ubuntu-latest + steps: + - name: Checkout + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@v2 + + - name: Login to Aliyun Registry + if: github.event_name == 'workflow_dispatch' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY_HOST }} + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ env.DOCKERHUB_TOKEN }} + + - name: Set up QEMU + if: github.event_name == 'workflow_dispatch' + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + if: github.event_name == 'workflow_dispatch' + uses: docker/setup-buildx-action@v3 + + - name: Build & push AMD64 image + if: github.event_name == 'workflow_dispatch' + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:web" + platforms: linux/amd64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }} + cache-from: type=gha,scope=dify-web-amd64 + cache-to: type=gha,mode=max,scope=dify-web-amd64 + + - name: Build & push ARM64 image + if: github.event_name == 'workflow_dispatch' + uses: docker/build-push-action@v6 + with: + context: "{{defaultContext}}:web" + platforms: linux/arm64 + push: true + tags: ${{ env.IMAGE_BASE }}:${{ inputs.tag }}-arm64 + cache-from: type=gha,scope=dify-web-arm64 + cache-to: type=gha,mode=max,scope=dify-web-arm64 \ No newline at end of file