feat: add build webui into ci. Change Dockerfile, add webui in release draft.

This commit is contained in:
EstrellaXD
2023-06-07 21:01:28 +08:00
parent fd160599fb
commit 77579a5a9c
3 changed files with 106 additions and 7 deletions

View File

@@ -27,7 +27,36 @@ jobs:
mkdir -p config
pytest
dev-latest:
build-webui:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: latest
run_install: true
- name: Build
run: pnpm build && zip -r dist.zip dist
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist.zip
dev-build:
runs-on: ubuntu-latest
needs: [test]
steps:
@@ -44,6 +73,12 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dist
path: dist.zip
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4

View File

@@ -26,19 +26,77 @@ jobs:
run: |
mkdir -p config
pytest
build:
build-webui:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: latest
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: latest
run_install: true
- name: Build
run: pnpm build && zip -r dist.zip dist
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist.zip
draft-release:
runs-on: ubuntu-latest
needs: [test]
if: >
github.event.pull_request.merged == true &&
github.event.pull_request.base.ref == 'main'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist.zip
- name: Generate Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.pull_request.title }}
name: 🌟${{ github.event.pull_request.title }}
body: ${{ github.event.pull_request.body }}
draft: true
prerelease: false
files: |
dist.zip
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
build-docker:
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Version info
working-directory: ./backend/src
run: |
echo "VERSION = '$GITHUB_REF_NAME'" > module/__version__.py
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -46,6 +104,12 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2
- name: download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist.zip
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4