mirror of
https://github.com/langgenius/dify.git
synced 2026-03-31 18:00:55 -04:00
Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: Build docker image
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- "main"
|
|
paths:
|
|
- api/Dockerfile
|
|
- web/docker/**
|
|
- web/Dockerfile
|
|
- package.json
|
|
- pnpm-lock.yaml
|
|
- pnpm-workspace.yaml
|
|
- .nvmrc
|
|
|
|
concurrency:
|
|
group: docker-build-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-docker:
|
|
runs-on: ${{ matrix.runs_on }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- service_name: "api-amd64"
|
|
platform: linux/amd64
|
|
runs_on: ubuntu-latest
|
|
context: "{{defaultContext}}:api"
|
|
file: "Dockerfile"
|
|
- service_name: "api-arm64"
|
|
platform: linux/arm64
|
|
runs_on: ubuntu-24.04-arm
|
|
context: "{{defaultContext}}:api"
|
|
file: "Dockerfile"
|
|
- service_name: "web-amd64"
|
|
platform: linux/amd64
|
|
runs_on: ubuntu-latest
|
|
context: "{{defaultContext}}"
|
|
file: "web/Dockerfile"
|
|
- service_name: "web-arm64"
|
|
platform: linux/arm64
|
|
runs_on: ubuntu-24.04-arm
|
|
context: "{{defaultContext}}"
|
|
file: "web/Dockerfile"
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
|
|
- name: Build Docker Image
|
|
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
|
|
with:
|
|
push: false
|
|
context: ${{ matrix.context }}
|
|
file: ${{ matrix.file }}
|
|
platforms: ${{ matrix.platform }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|