Skip to content

refactor(.github/workflows): 更新并重命名部署工作流文件 #1

refactor(.github/workflows): 更新并重命名部署工作流文件

refactor(.github/workflows): 更新并重命名部署工作流文件 #1

# 将静态内容部署到 GitHub Pages 的简易工作流程
name: Deploy to Github Pages
on:
# 在main分支发生改变时运行。
push:
branches: ['main']
pull_request:
branches: ['main']
# 这个选项可以使你手动在 Action tab 页面触发工作流
workflow_dispatch:
jobs:
# 部署
deploy:
# 运行环境
runs-on: ubuntu-latest
# 权限
permissions:
contents: read
pages: write
# 环境变量
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# 步骤
steps:
- name: Checkout
uses: actions/checkout@latest
- name: Set up Node.js
uses: actions/setup-node@latest
with:
node-version: 'latest'
- name: Install dependencies
run: npm install
- name: Build Vue 3 Project
run: npm run build
- name: Configure GitHub Pages
uses: actions/configure-pages@latest
- name: Upload artifact
uses: actions/upload-pages-artifact@latest
with:
path: './dist'
- name: Deploy to Github Pages
id: deployment
uses: actions/deploy-pages@latest