From 5ae5c3879690a47e9d71efd2fa60685ca731507d Mon Sep 17 00:00:00 2001 From: CaasianVale <1544257291@qq.com> Date: Sat, 8 Mar 2025 05:14:42 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=94=B9=E4=B8=BA=E5=8D=95=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index be82fe6..85ee1a3 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -26,16 +26,6 @@ jobs: build: needs: prepare runs-on: ubuntu-latest - strategy: - matrix: - service: [backend, frontend] - include: - - service: backend - context: . - - service: frontend - context: ./frontend - # 允许其中一个任务失败时,其他任务仍继续执行 - fail-fast: false steps: - name: Checkout code @@ -59,7 +49,7 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ secrets.DOCKERHUB_USERNAME }}/stock-scanner-${{ matrix.service }} + images: ${{ secrets.DOCKERHUB_USERNAME }}/stock-scanner tags: | type=raw,value=latest type=raw,value=${{ needs.prepare.outputs.version }} @@ -67,12 +57,12 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - context: ${{ matrix.context }} + context: . platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha,scope=${{ matrix.service }} - cache-to: type=gha,scope=${{ matrix.service }},mode=max + cache-from: type=gha,scope=stock-scanner + cache-to: type=gha,scope=stock-scanner,mode=max deploy: needs: [prepare, build] @@ -149,13 +139,8 @@ jobs: sleep 10 # 验证服务是否正常运行 - if ! curl -s http://localhost:80 > /dev/null; then - echo "前端服务未正常运行!" - exit 1 - fi - - if ! curl -s http://localhost:8888/config > /dev/null; then - echo "后端服务未正常运行!" + if ! curl -s http://localhost:8888/api/config > /dev/null; then + echo "服务未正常运行!" exit 1 fi