Skip to content

commit and update website #4

commit and update website

commit and update website #4

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Deploy to GitHub Pages
# Controls when the workflow will run
on:
# Triggers the workflow on push events but only for the master branch
push:
branches:
- master # 触发部署的分支(例如 main 或 master)
permissions:
pages: write # 允许部署到 Pages
id-token: write # 允许使用 OIDC 令牌
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# 1. 检出代码
- name: Checkout repository
uses: actions/checkout@v4
# 2. 上传构建产物作为 Artifact(关键修复!)
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist # 静态文件目录
# 3.部署到 GitHub Pages(无需 gh-pages 分支)
- name: Deploy to Pages
uses: actions/deploy-pages@v2 # GitHub 官方 Actions(Beta)