From 2f6d743cf07ebf6185ac4d237ac77cd2a6b91fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Mon, 13 May 2024 18:42:07 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20CI=20=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/jms-build-test.yml | 45 ++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.github/workflows/jms-build-test.yml b/.github/workflows/jms-build-test.yml index 8b6c98376..5b1942cea 100644 --- a/.github/workflows/jms-build-test.yml +++ b/.github/workflows/jms-build-test.yml @@ -1,26 +1,32 @@ name: "Run Build Test" on: push: - branches: - - pr@* - - repr@* + paths: + - 'Dockerfile' + - 'Dockerfile-*' + - 'pyproject.toml' + - 'poetry.lock' jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - - uses: docker/setup-qemu-action@v2 + - name: Check Dockerfile + run: | + test -f Dockerfile-ce || cp -f Dockerfile Dockerfile-ce - - uses: docker/setup-buildx-action@v2 - - - uses: docker/build-push-action@v3 + - name: Build CE Image + uses: docker/build-push-action@v5 with: context: . push: false - tags: jumpserver/core-ce:test file: Dockerfile-ce + tags: jumpserver/core-ce:test + platforms: linux/amd64 build-args: | APT_MIRROR=http://deb.debian.org PIP_MIRROR=https://pypi.org/simple @@ -28,9 +34,22 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max - - uses: LouisBrunner/checks-action@v1.5.0 - if: always() + - name: Prepare EE Image + run: | + sed -i 's@^FROM registry.fit2cloud.com@# FROM registry.fit2cloud.com@g' Dockerfile-ee + sed -i 's@^COPY --from=build-xpack@# COPY --from=build-xpack@g' Dockerfile-ee + + - name: Build EE Image + uses: docker/build-push-action@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Check Build - conclusion: ${{ job.status }} + context: . + push: false + file: Dockerfile-ee + tags: jumpserver/core-ee:test + platforms: linux/amd64 + build-args: | + APT_MIRROR=http://deb.debian.org + PIP_MIRROR=https://pypi.org/simple + PIP_JMS_MIRROR=https://pypi.org/simple + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file