fix: CI typecheck and native ARM Docker builds for v1.0.3

Fix TypeScript errors blocking CI, split Docker publish into
native amd64/arm64 jobs with manifest merge, and add npm cache mounts.
This commit is contained in:
O96u committed 2026-08-23 18:26:13 +08:00
1 parent 22cb2ca8bc
commit 9d2ee96af0
11 files changed
+96 -28

No files matched your search

+62 -19
View File
@@ -13,9 +13,19 @@ env:
IMAGE_NAME: pichost
jobs:
build-and-push:
build:
if: ${{ !contains(github.event.head_commit.message, '[skip docker]') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
suffix: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
suffix: arm64
runs-on: ${{ matrix.runner }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -23,9 +33,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v7
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -35,22 +42,58 @@ jobs:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
- name: Resolve version
id: version
run: |
if [ "${{ github.ref_type }}" = "tag" ]; then
echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
else
echo "value=dev" >> "$GITHUB_OUTPUT"
fi
- name: Build and push
- name: Build and push platform image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ matrix.platform }}
tags: |
${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.value }}-${{ matrix.suffix }}
cache-from: type=gha,scope=${{ matrix.suffix }}
cache-to: type=gha,mode=max,scope=${{ matrix.suffix }}
merge:
if: ${{ !contains(github.event.head_commit.message, '[skip docker]') }}
needs: build
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Resolve version
id: version
run: |
if [ "${{ github.ref_type }}" = "tag" ]; then
echo "value=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
else
echo "value=dev" >> "$GITHUB_OUTPUT"
fi
- name: Create multi-arch manifest
run: |
IMAGE="${DOCKERHUB_USERNAME}/${IMAGE_NAME}"
VERSION="${{ steps.version.outputs.value }}"
docker buildx imagetools create \
-t "${IMAGE}:${VERSION}" \
-t "${IMAGE}:latest" \
"${IMAGE}:${VERSION}-amd64" \
"${IMAGE}:${VERSION}-arm64"
+9
View File
@@ -2,6 +2,14 @@
本仓库自 **v1.0.0** 起作为正式版维护;此前历史提交已归档重置。
## [1.0.3] - 2026-08-23
### 修复
- 修复 CI typecheck 失败(移动端菜单、i18n、统计页图库刷新)
- Docker 构建:arm64 改用原生 ARM Runner,避免 QEMU 下 `npm ci` 极慢
- Docker 构建:启用 npm 缓存挂载,加快依赖安装
## [1.0.2] - 2026-08-23
### 新增
@@ -47,6 +55,7 @@
- **v1.1.0**(计划中):S3、Cloudflare R2 及更多对象存储后端
[1.0.3]: https://github.com/O96u/PicHost/releases/tag/v1.0.3
[1.0.2]: https://github.com/O96u/PicHost/releases/tag/v1.0.2
[1.0.1]: https://github.com/O96u/PicHost/releases/tag/v1.0.1
[1.0.0]: https://github.com/O96u/PicHost/releases/tag/v1.0.0
+4 -1
View File
@@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
FROM node:22-alpine AS build
WORKDIR /app
@@ -6,7 +8,8 @@ WORKDIR /app
RUN npm install -g npm@11.12.1
COPY package.json package-lock.json ./
RUN npm ci
RUN --mount=type=cache,target=/root/.npm \
npm ci
COPY . .
RUN npm run build
+2 -1
View File
@@ -194,7 +194,8 @@ npm test # Unit tests
| Version | Plan |
|---------|------|
| **v1.0.2** | i18n, mobile menus, stats/upload UI, Docker password reset (current) |
| **v1.0.3** | CI and Docker multi-arch build fixes (current) |
| **v1.0.2** | i18n, mobile menus, stats/upload UI, Docker password reset |
| **v1.0.1** | Settings version display, mobile upload preferences layout fix |
| **v1.0.0** | Local storage, multi-user, API, Twikoo |
| **v1.1.0** | S3, Cloudflare R2, and more object storage backends |
+2 -1
View File
@@ -199,7 +199,8 @@ npm test # 单元测试
| 版本 | 计划 |
|------|------|
| **v1.0.2** | 中英文、移动端菜单、统计/上传 UI、Docker 重置密码(当前) |
| **v1.0.3** | CI 与 Docker 多架构构建修复(当前) |
| **v1.0.2** | 中英文、移动端菜单、统计/上传 UI、Docker 重置密码 |
| **v1.0.1** | 设置页版本展示、移动端上传偏好布局修复 |
| **v1.0.0** | 本地存储、多用户、API、Twikoo |
| **v1.1.0** | S3、Cloudflare R2 等对象存储后端 |
+5 -1
View File
@@ -36,6 +36,10 @@ watch(open, (isOpen) => {
onUnmounted(() => {
document.removeEventListener('click', onDocumentClick, true)
})
function toggleOpen() {
open.value = !open.value
}
</script>
<template>
@@ -50,7 +54,7 @@ onUnmounted(() => {
icon="i-lucide-menu"
:aria-label="t('nav.menu')"
:aria-expanded="open"
@click.stop="open = !open"
@click.stop="toggleOpen"
/>
<div
+5 -1
View File
@@ -37,6 +37,10 @@ watch(open, (isOpen) => {
onUnmounted(() => {
document.removeEventListener('click', onDocumentClick, true)
})
function toggleOpen() {
open.value = !open.value
}
</script>
<template>
@@ -51,7 +55,7 @@ onUnmounted(() => {
icon="i-lucide-user"
:aria-label="t('nav.account')"
:aria-expanded="open"
@click.stop="open = !open"
@click.stop="toggleOpen"
/>
<div
+3 -1
View File
@@ -83,7 +83,9 @@ export function useAppearanceMenus() {
}
async function setLocalePreference(code: string) {
await setLocale(code)
if (code === 'zh-CN' || code === 'en') {
await setLocale(code)
}
}
return {
+1
View File
@@ -188,6 +188,7 @@ export function useImageList() {
activeSearch,
listSummary,
fetchList,
fetchSearch,
fetchTotal,
refreshList,
initializeList,
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "pichost",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pichost",
"version": "1.0.2",
"version": "1.0.3",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "pichost",
"version": "1.0.2",
"version": "1.0.3",
"description": "Self-hosted image hosting for your NAS / home server — Nuxt admin UI, local disk storage, server-side WebP compression, referer protection, Twikoo/EasyImage compatible.",
"homepage": "https://github.com/O96u/PicHost#readme",
"repository": {