add site #6
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: Deploy to gh-pages | |
on: | |
push: | |
branches: | |
- main # 监听main分支的更新 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js (optional, depending on your project) | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
- name: Install dependencies (optional) | |
run: | | |
npm install # 如果需要安装依赖,可以加入此步 | |
- name: Build site (optional, if you need to build your site) | |
run: | | |
# 在这里放置构建你网站的命令,比如: | |
# npm run build | |
# 如果你的网站已经是预构建好的内容,可以跳过此步骤 | |
echo "Build complete" | |
- name: Deploy to gh-pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # 目标分支 | |
folder: site/_site # 源文件夹 | |
clean: true # 清理目标分支中的其他文件 | |
force_orphan: true # 强制覆盖并创建一个没有历史的孤立分支 | |
token: ${{ secrets.GITHUB_TOKEN }} # GitHub token 用于认证 |