mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 18:27:19 +08:00
83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
name: Build docker image
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- api/Dockerfile
|
|
- web/Dockerfile
|
|
|
|
concurrency:
|
|
group: docker-build-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-docker:
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: ${{ matrix.runs_on }}
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- service_name: "api-amd64"
|
|
platform: linux/amd64
|
|
runs_on: depot-ubuntu-24.04-4
|
|
context: "{{defaultContext}}:api"
|
|
file: "Dockerfile"
|
|
- service_name: "api-arm64"
|
|
platform: linux/arm64
|
|
runs_on: depot-ubuntu-24.04-4
|
|
context: "{{defaultContext}}:api"
|
|
file: "Dockerfile"
|
|
- service_name: "web-amd64"
|
|
platform: linux/amd64
|
|
runs_on: depot-ubuntu-24.04-4
|
|
context: "{{defaultContext}}"
|
|
file: "web/Dockerfile"
|
|
- service_name: "web-arm64"
|
|
platform: linux/arm64
|
|
runs_on: depot-ubuntu-24.04-4
|
|
context: "{{defaultContext}}"
|
|
file: "web/Dockerfile"
|
|
steps:
|
|
- name: Set up Depot CLI
|
|
uses: depot/setup-action@v1
|
|
|
|
- name: Build Docker Image
|
|
uses: depot/build-push-action@v1
|
|
with:
|
|
project: ${{ vars.DEPOT_PROJECT_ID }}
|
|
push: false
|
|
context: ${{ matrix.context }}
|
|
file: ${{ matrix.file }}
|
|
platforms: ${{ matrix.platform }}
|
|
|
|
build-docker-fork:
|
|
if: github.event.pull_request.head.repo.full_name != github.repository
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- service_name: "api-amd64"
|
|
context: "{{defaultContext}}:api"
|
|
file: "Dockerfile"
|
|
- service_name: "web-amd64"
|
|
context: "{{defaultContext}}"
|
|
file: "web/Dockerfile"
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@98e3b2c9eab4f4f98a95c0c0a3ea5e5e672fd2a8 # v3.10.0
|
|
|
|
- name: Build Docker Image
|
|
uses: docker/build-push-action@5cd29d66b4a8d8e6f4d5dfe2e9329f0b1d446289 # v6.18.0
|
|
with:
|
|
push: false
|
|
context: ${{ matrix.context }}
|
|
file: ${{ matrix.file }}
|
|
platforms: linux/amd64
|