Skip to content

Merge pull request #102 from ZhQuella/main-feat/new #194

Merge pull request #102 from ZhQuella/main-feat/new

Merge pull request #102 from ZhQuella/main-feat/new #194

Workflow file for this run

# 将静态内容部署到 GitHub Pages 的简易工作流程
name: Deploy static content to Pages
on:
# 仅在推送到默认分支时运行。
push:
branches: ["main"]
# 这个选项可以使你手动在 Action tab 页面触发工作流
workflow_dispatch:
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages。
permissions:
contents: read
pages: write
id-token: write
# 允许一个并发的部署
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# 单次部署的工作描述
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
# 检出代码
- name: Checkout
uses: actions/checkout@v3
# 设置 pnpm
- name: Set up pnpm
uses: pnpm/[email protected]
with:
version: 8.6.2
# 缓存 pnpm 的 node_modules,提升构建速度
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# 安装依赖
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
# 构建项目
- name: Build project
run: pnpm run build
# 设置 Pages
- name: Setup Pages
uses: actions/configure-pages@v4
# 检查目录存在性
- name: List build directory
run: ls -R ${{ github.workspace }}/sample/dist
# 调试输出
- name: Set output for debugging
run: echo "Uploading path: ${{ github.workspace }}/sample/dist"

Check failure on line 68 in .github/workflows/CD.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/CD.yml

Invalid workflow file

You have an error in your yaml syntax on line 68
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.workspace }}/sample/dist
artifact_name: dist
# 部署到 GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
with:
artifact_name: dist