From 8ea7841e49580fa98e94675abc32ebfa02efdc3f Mon Sep 17 00:00:00 2001
From: hemengyang <hmy0119@hotmail.com>
Date: Fri, 20 May 2022 04:04:21 +0000
Subject: [PATCH] =?UTF-8?q?ci:=20=E5=B0=9D=E8=AF=95=E4=BD=BF=E7=94=A8=20ma?=
 =?UTF-8?q?trix=20=E7=AE=80=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .github/workflows/main.yml | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index b5cc8e0..c6d4e5f 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -67,6 +67,13 @@ jobs:
     name: Docker
     runs-on: ubuntu-latest
     needs: [build-frontend, test]
+    strategy:
+      matrix:
+        include:
+          - file: ./docker/Dockerfile_with_frontend
+            tags: felinae98/nonebot-bison:main
+          - file: ./docker/Dockerfile_with_frontend_sentry
+            tags: felinae98/nonebot-bison:main-sentry
 
     steps:
       - uses: actions/checkout@v3
@@ -94,18 +101,8 @@ jobs:
         uses: docker/build-push-action@v2
         with:
           context: .
-          file: ./docker/Dockerfile_with_frontend
+          file: ${{ matrix.file }}
           push: ${{ github.event_name != 'pull_request' }}
-          tags: felinae98/nonebot-bison:main
-          cache-from: type=gha
-          cache-to: type=gha,mode=max
-
-      - name: Build Sentry and push
-        uses: docker/build-push-action@v2
-        with:
-          context: .
-          file: ./docker/Dockerfile_with_frontend_sentry
-          push: ${{ github.event_name != 'pull_request' }}
-          tags: felinae98/nonebot-bison:main-sentry
+          tags: ${{ matrix.tags }}
           cache-from: type=gha
           cache-to: type=gha,mode=max