From abdd7f245fcac580544bc74e3d0af072269b69fb Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sun, 22 Sep 2024 21:50:26 +0800 Subject: [PATCH] feat: add Docker Hub --- .github/workflows/Deploy.yml | 7 +++++++ app/api/server/route.ts | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 12a53dd..b4ca664 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -13,6 +13,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to AliYun Container Registry uses: docker/login-action@v3 with: @@ -25,6 +31,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | + hamster1963/nezha-dash registry.cn-guangzhou.aliyuncs.com/hamster-home/nezha-dash tags: | type=raw,value=latest diff --git a/app/api/server/route.ts b/app/api/server/route.ts index 07b0848..f47afb7 100644 --- a/app/api/server/route.ts +++ b/app/api/server/route.ts @@ -9,6 +9,9 @@ export async function GET(_: Request) { return NextResponse.json(response, { status: 200 }); } catch (error) { console.error(error); - return NextResponse.json({ error: "fetch nezha data failed" }, { status: 400 }); + return NextResponse.json( + { error: "fetch nezha data failed" }, + { status: 400 }, + ); } }