♻️ 更新 action workflow

This commit is contained in:
suyiiyii 2024-12-22 21:02:32 +08:00
parent 8550ff975a
commit 6c8b37f085
Signed by: suyiiyii
GPG Key ID: 044704CB29B8AD85
4 changed files with 16 additions and 63 deletions

View File

@ -14,7 +14,9 @@ runs:
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Setup Poetry
uses: Gr1N/setup-poetry@v9
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
poetry-version: "1.7.1"
version: "latest"
enable-cache: true

View File

@ -127,12 +127,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download frontend files
uses: actions/download-artifact@v4
with:
name: frontend
path: ./nonebot_bison/admin_page/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -144,7 +138,7 @@ jobs:
if: github.event_name == 'pull_request'
with:
context: .
file: ./docker/Dockerfile_with_frontend
file: ./docker/Dockerfile
push: false
load: true
tags: felinae98/nonebot-bison:dummy
@ -174,7 +168,7 @@ jobs:
if: github.event_name != 'pull_request'
with:
context: .
file: ./docker/Dockerfile_with_frontend
file: ./docker/Dockerfile
push: true
tags: felinae98/nonebot-bison:${{ env.GIT_BRANCH_NAME }}
cache-from: type=gha
@ -188,12 +182,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Download frontend files
uses: actions/download-artifact@v4
with:
name: frontend
path: ./nonebot_bison/admin_page/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -215,8 +203,8 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile_with_frontend_sentry
file: ./docker/Dockerfile_without_browser
push: ${{ github.event_name != 'pull_request' }}
tags: felinae98/nonebot-bison:${{ env.GIT_BRANCH_NAME }}-sentry
tags: felinae98/nonebot-bison:${{ env.GIT_BRANCH_NAME }}-nobrowser
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -9,35 +9,12 @@ on:
type: string
jobs:
build-frontend:
name: Build Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Frontend
uses: ./.github/actions/build-frontend
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: frontend
path: ./admin-frontend/build/
docker-main:
name: Docker main
runs-on: ubuntu-latest
needs: [build-frontend]
steps:
- uses: actions/checkout@v4
- name: Download frontend files
uses: actions/download-artifact@v4
with:
name: frontend
path: ./src/plugins/nonebot_bison/admin_page/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -54,7 +31,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile_with_frontend
file: ./docker/Dockerfile
push: true
tags: felinae98/nonebot-bison:${{ inputs.dockerTag }}
cache-from: type=gha
@ -63,16 +40,9 @@ jobs:
docker-main-sentry:
name: Docker main sentry
runs-on: ubuntu-latest
needs: [build-frontend]
steps:
- uses: actions/checkout@v4
- name: Download frontend files
uses: actions/download-artifact@v4
with:
name: frontend
path: ./src/plugins/nonebot_bison/admin_page/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -89,7 +59,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile_with_frontend_sentry
tags: felinae98/nonebot-bison:${{ inputs.dockerTag }}-sentry
file: ./docker/Dockerfile_without_browser
tags: felinae98/nonebot-bison:${{ inputs.dockerTag }}-nobrowser
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -61,17 +61,10 @@ jobs:
publish-docker:
runs-on: ubuntu-latest
needs: build-frontend
steps:
- uses: actions/checkout@v4
- name: Download frontend files
uses: actions/download-artifact@v4
with:
name: frontend
path: ./nonebot_bison/admin_page/dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -92,7 +85,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile_with_frontend
file: ./docker/Dockerfile
push: true
tags: |
felinae98/nonebot-bison:latest
@ -104,10 +97,10 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile_with_frontend_sentry
file: ./docker/Dockerfile_without_browser
push: true
tags: |
felinae98/nonebot-bison:${{ env.TAG_NAME }}-sentry
felinae98/nonebot-bison:sentry
felinae98/nonebot-bison:${{ env.TAG_NAME }}-nobrowser
felinae98/nonebot-bison:nobrowser
cache-from: type=gha
cache-to: type=gha,mode=max