mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-30 06:35:14 +08:00
chore: add tests for build docker image when dockerfile changed (#10732)
This commit is contained in:
parent
55ce3618ce
commit
2ad7ee0344
47
.github/workflows/docker-build.yml
vendored
Normal file
47
.github/workflows/docker-build.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
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:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- service_name: "api-amd64"
|
||||||
|
platform: linux/amd64
|
||||||
|
context: "api"
|
||||||
|
- service_name: "api-arm64"
|
||||||
|
platform: linux/arm64
|
||||||
|
context: "api"
|
||||||
|
- service_name: "web-amd64"
|
||||||
|
platform: linux/amd64
|
||||||
|
context: "web"
|
||||||
|
- service_name: "web-arm64"
|
||||||
|
platform: linux/arm64
|
||||||
|
context: "web"
|
||||||
|
steps:
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: false
|
||||||
|
context: "{{defaultContext}}:${{ matrix.context }}"
|
||||||
|
platforms: ${{ matrix.platform }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
@ -78,7 +78,6 @@ COPY . /app/api/
|
|||||||
COPY docker/entrypoint.sh /entrypoint.sh
|
COPY docker/entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
|
||||||
ARG COMMIT_SHA
|
ARG COMMIT_SHA
|
||||||
ENV COMMIT_SHA=${COMMIT_SHA}
|
ENV COMMIT_SHA=${COMMIT_SHA}
|
||||||
|
|
||||||
|
@ -63,7 +63,6 @@ RUN yarn global add pm2 \
|
|||||||
&& chown -R 1001:0 /.pm2 /app/web \
|
&& chown -R 1001:0 /.pm2 /app/web \
|
||||||
&& chmod -R g=u /.pm2 /app/web
|
&& chmod -R g=u /.pm2 /app/web
|
||||||
|
|
||||||
|
|
||||||
ARG COMMIT_SHA
|
ARG COMMIT_SHA
|
||||||
ENV COMMIT_SHA=${COMMIT_SHA}
|
ENV COMMIT_SHA=${COMMIT_SHA}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user