From 743d863e13b94d9a5ff190ca085d3a172d343c5d Mon Sep 17 00:00:00 2001 From: hemengyang Date: Wed, 18 May 2022 14:10:06 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecov.yml | 47 ++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 8760da4..669fadb 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -25,7 +25,6 @@ jobs: with: name: frontend path: ./admin-frontend/build/ - test: name: Test Coverage runs-on: ${{ matrix.os }} @@ -66,3 +65,49 @@ jobs: uses: codecov/codecov-action@v3 with: env_vars: OS,PYTHON_VERSION + docker: + name: Docker + runs-on: ubuntu-latest + needs: [build-frontend, test] + + steps: + - uses: actions/checkout@v3 + + - name: Download frontend files + uses: actions/download-artifact@v2 + with: + name: frontend + path: ./src/plugins/nonebot_bison/admin_page/dist + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile_with_frontend + 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 + cache-from: type=gha + cache-to: type=gha,mode=max