From dd3dbf20ad3ead30ad1187d7508dc6ee14076192 Mon Sep 17 00:00:00 2001 From: Zephyruso <176294927+Zephyruso@users.noreply.github.com> Date: Wed, 4 Dec 2024 18:38:10 +0800 Subject: [PATCH] feat: ghcr --- .github/workflows/deploy.yml | 37 +++++++++++++++++++++++++++++++++++- README.md | 14 ++++---------- vite.config.ts | 4 ++++ 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6f8c51b6..6a4d7e47 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,4 +41,39 @@ jobs: uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.PAT }} - publish_dir: ./dist \ No newline at end of file + publish_dir: ./dist + + release-image: + needs: release-please + runs-on: ubuntu-latest + if: ${{ needs.release-please.outputs.release_created }} + steps: + - uses: actions/checkout@v4 + + - name: set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: set up docker buildx + uses: docker/setup-buildx-action@v3 + id: buildx + + - name: login to ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.PAT }} + + - name: build and publish ghcr.io docker image + uses: docker/build-push-action@v6 + with: + context: . + builder: ${{ steps.buildx.outputs.name }} + file: Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/zephyruso/zashboard:latest + ghcr.io/zephyruso/zashboard:${{ needs.release-please.outputs.tag_name }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/README.md b/README.md index f97a6128..1580c81e 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,9 @@ 1. Both PC and mobile devices can toggle the sidebar/menu to a collapsed state. After collapsing, the control widgets will be displayed within the main page. 2. The connection page has two layout styles: cards and customizable tables. It is recommended to use tables on PC and cards on mobile devices. 3. Quick filtering allows one-click exclusion of connections matching proxy chains, host, or destination IPs using regular expressions. -4. zashboard currently doesn't have a Docker Hub image, but you can use the following command to build the image yourself. +4. Docker ``` -git clone https://github.com/Zephyruso/zashboard.git -cd zashboard -docker build -t zashboard . -docker run -p 80:80 zashboard +docker run -p 80:80 ghcr.io/zephyruso/zashboard ``` 5. GitHub Pages no longer allows disabling HTTPS. If you are using the https://zephyruso.github.io/ and the backend IP you are accessing is not local, please set your browser to allow insecure content for the https://zephyruso.github.io/. ![alt text](image.png) @@ -18,12 +15,9 @@ docker run -p 80:80 zashboard 1. PC 和移动设备均可切换侧边栏/菜单至折叠状态。折叠后,控制小组件将显示在主页面内。 2. 连接页面有两种布局样式:卡片和可自定义表格。建议在 PC 上使用表格,在移动设备上使用卡片。 3. 快速筛选使用正则表达式进行匹配,支持一键排除符合代理链、主机或目标 IP 的连接。 -4. zashboard暂时没有docker hub镜像,不过你可以使用下面的命令自己构建出镜像 +4. Docker ``` -git clone https://github.com/Zephyruso/zashboard.git -cd zashboard -docker build -t zashboard . -docker run -p 80:80 zashboard +docker run -p 80:80 ghcr.io/zephyruso/zashboard ``` 5. GitHub Pages现在不允许关闭https,如果你使用在线面板并且访问的后端IP不是本机,请将浏览器中在线面板的不安全的内容设置为允许。 diff --git a/vite.config.ts b/vite.config.ts index 648a9f39..1e5adc1f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -18,6 +18,10 @@ export default defineConfig({ registerType: 'autoUpdate', includeAssets: ['favicon.svg'], manifest: { + name: 'zashboard', + short_name: 'zashboard', + description: 'a dashboard using clash api', + theme_color: '#000000', icons: [ { "src": "./pwa-192x192.png",