feat ✨: 添加每日积累文档 #39
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: Sync To Gitee #名字 可自定义 | |
# on: [push, delete, create] #触发条件 page_build表示Github Page部署完成后触发 | |
# jobs: | |
# sync: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: wearerequired/git-mirror-action@master #开源actions包 | |
# env: | |
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }} | |
# with: | |
# source-repo: '[email protected]:Tricker39/programming-knowledge.git' # github仓库地址 | |
# destination-repo: '[email protected]:Tricker39/programming-knowledge.git' # gitee仓库地址 | |
name: A TO A:GH_PAGES | |
on: [push] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build and Deploy | |
uses: jenkey2011/vuepress-deploy@master | |
env: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
# 你要操作的目标仓库 | |
TARGET_REPO: Tricker39/programming-knowledge | |
# 构建结果存储的分支 | |
TARGET_BRANCH: gh_pages | |
# 要使用的构建命令 | |
BUILD_SCRIPT: npm install && npm run docs:build | |
# 构建结果存储目录 | |
BUILD_DIR: .vitepress/dist/ | |
sync: | |
needs: build-and-deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync to Gitee | |
uses: wearerequired/git-mirror-action@master | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} | |
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} | |
with: | |
# 来源仓库 | |
source-repo: '[email protected]:Tricker39/programming-knowledge.git' | |
# 目标仓库 | |
destination-repo: '[email protected]:Tricker39/programming-knowledge.git' | |
reload-pages: | |
needs: sync | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build Gitee Pages | |
uses: yanglbme/gitee-pages-action@main | |
with: | |
# 注意替换为你的 Gitee 用户名 | |
gitee-username: Tricker39 | |
# 注意在 Settings->Secrets 配置 GITEE_PASSWORD | |
gitee-password: ${{ secrets.GITEE_PASSWORD }} | |
# 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错 | |
gitee-repo: Tricker39/programming-knowledge | |
# 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在) | |
branch: gh_pages |