From 425a6da49dacf72286a42189cad4a3de69876a73 Mon Sep 17 00:00:00 2001 From: Elliot-32 <115418645+Elliot-32@users.noreply.github.com> Date: Fri, 22 Nov 2024 02:34:59 +0800 Subject: [PATCH] Create deploy.yml --- .github/workflows/deploy.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3464bcd --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy to GitHub Pages + +on: + # 每次推送到 `main` 分支时触发这个“工作流程” + # 如果你使用了别的分支名,请按需将 `main` 替换成你的分支名 + push: + branches: [ main ] + # 允许你在 GitHub 上的 Actions 标签中手动触发此“工作流程” + workflow_dispatch: + +# 允许 job 克隆 repo 并创建一个 page deployment +permissions: + contents: read + pages: write + id-token: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout your repository using git + uses: actions/checkout@v4 + - name: Install, build, and upload your site + uses: withastro/action@v3 + # with: + # path: . # 存储库中 Astro 项目的根位置。(可选) + # node-version: 20 # 用于构建站点的特定 Node.js 版本,默认为 20。(可选) + # package-manager: pnpm@latest # 应使用哪个 Node.js 包管理器来安装依赖项和构建站点。会根据存储库中的 lockfile 自动检测。(可选) + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4