From fc795d3e872e24fa73021088a7f159bdd5cc1b56 Mon Sep 17 00:00:00 2001 From: liuyiwuqing <1520431201@qq.com> Date: Tue, 10 Jun 2025 20:43:37 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Halo=20=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 GitHub Actions 工作流,用于将项目部署到 Halo - 工作流在 Ubuntu 最新版本上运行,包含以下步骤: -检出代码 - 设置 pnpm - 设置 Node.js 环境 -安装依赖 - 构建项目 - 使用 Halo静态页面部署 CLI 工具进行部署 - 部署所需的 Halo 相关密钥(ENDPOINT、ID、PAT)需在 GitHub 仓库设置中配置 --- .github/workflows/cd.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/cd.yaml diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 00000000..3ca36e5b --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,26 @@ +name: Deploy to Halo + +on: + push: + branches: [main] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: pnpm/action-setup@v3 + with: + version: 8 + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + - name: Build + run: pnpm build + - name: Deploy to Halo + run: | + npx halo-static-pages-deploy-cli deploy -e ${{ secrets.ENDPOINT }} -i ${{ secrets.ID }} -t ${{ secrets.PAT }} -f dist \ No newline at end of file