chore: update #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Vue Deploy | |
on: | |
# 当推送到默认分支时触发 | |
push: | |
branches: [ "main" ] | |
# 允许从 GitHub Actions 页面手动触发 | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# 构建任务 | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 检出代码 | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
# 设置 Node.js 环境 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
# 安装 pnpm | |
- name: Install pnpm | |
run: npm install -g pnpm | |
# 安装依赖 | |
- name: Install Dependencies | |
run: pnpm install | |
# 构建 Vue.js 项目 | |
- name: Build Vue.js Project | |
run: pnpm build | |
# 上传构建产物 | |
- name: Upload github-pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist # Vue.js 默认的构建输出目录为 dist | |
# 部署任务 | |
# deploy: | |
# environment: | |
# name: github-pages | |
# url: ${{ steps.deployment.outputs.page_url }} | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# 部署到 GitHub Pages | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |