From 9fe3abdf5bd6a682ef14f1dffdeb6cb37bf8ee61 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Fri, 10 Apr 2026 19:36:19 +0800 Subject: [PATCH] chore(ci): publishes ui-server-auth as assets image --- .github/workflows/release-docker-assets.yml | 79 +++++++++++++++++++++ apps/ui-server-auth/Dockerfile | 4 ++ apps/ui-server-auth/src/main.ts | 3 +- 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-docker-assets.yml create mode 100644 apps/ui-server-auth/Dockerfile diff --git a/.github/workflows/release-docker-assets.yml b/.github/workflows/release-docker-assets.yml new file mode 100644 index 000000000..48a835b4a --- /dev/null +++ b/.github/workflows/release-docker-assets.yml @@ -0,0 +1,79 @@ +name: Release Docker / OCI for Assets + +on: + push: + branches: + - 'main' + paths: + - 'apps/ui-server-auth/**' + workflow_dispatch: + +jobs: + ghcr_build_assets: + name: Release Assets + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + include: + - assets_name: ui-server-auth + build_directory: ./apps/ui-server-auth/dist + build_command: | + pnpm -F @proj-airi/ui-server-auth run build + steps: + # Why? + # + # failed to build archive at `/home/runner/work/airi/airi/target/x86_64-unknown-linux-gnu/release/deps/libapp_lib.rlib`: + # No space left on device (os error 28) + - name: Free Disk Space + uses: jlumbroso/free-disk-space@main + + - uses: actions/checkout@v6 + # Turborepo + - name: Cache turbo build setup + uses: actions/cache@v5 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v6 + with: + node-version: lts/* + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: ${{ matrix.build_command }} + + - uses: docker/metadata-action@v5 + id: meta + with: + images: ghcr.io/${{ github.repository }}/${{ matrix.assets_name }} + flavor: | + latest=true + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} + + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: ./apps/ui-server-auth/dist + file: ./apps/ui-server-auth/Dockerfile + build-args: | + VITE_ENABLE_POSTHOG=true + platforms: linux/amd64,linux/arm64,linux/arm64/v8 + cache-from: type=gha + cache-to: type=gha,mode=max + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/apps/ui-server-auth/Dockerfile b/apps/ui-server-auth/Dockerfile new file mode 100644 index 000000000..3fe24b2bb --- /dev/null +++ b/apps/ui-server-auth/Dockerfile @@ -0,0 +1,4 @@ +FROM scratch + +WORKDIR /app/airi/projects/ui/ui-server-auth +COPY . /app/airi/projects/ui/ui-server-auth diff --git a/apps/ui-server-auth/src/main.ts b/apps/ui-server-auth/src/main.ts index 68999ecb4..2e7005e77 100644 --- a/apps/ui-server-auth/src/main.ts +++ b/apps/ui-server-auth/src/main.ts @@ -16,8 +16,7 @@ import App from './App.vue' import { i18n } from './modules/i18n' -import '@proj-airi/font-cjkfonts-allseto/index.css' -import '@proj-airi/font-xiaolai/index.css' +import '@proj-airi/font-chillroundm/index.css' import '@unocss/reset/tailwind.css' import 'vue-sonner/style.css' import './styles/main.css'