feat: update #25
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: resume-doc CI | |
# master branch on push, auto run | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# check it to your workflow can access it | |
# from: https://github.com/marketplace/actions/checkout?version=v3.6.0 | |
# v3 版本是新的版本,提供了更多功能和选项。除了将代码检出到工作目录外,它还支持子模块、LFS(大文件存储)和深度克隆等功能 | |
- name: Checkout Repository main branch | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Checkout private submodules(themes or something else) | |
# from: https://github.com/actions/setup-node | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Setup Hexo Dependencies | |
run: | | |
npm install -g hexo-cli | |
npm install | |
- name: Setup Deploy Private Key | |
env: | |
HEXO_DEPLOY_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN }} # 这个就是Source仓库的私钥 | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$HEXO_DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
- name: Setup Git Infomation | |
run: | | |
git config --global user.name "github-action" | |
git config --global user.email "github-action@no-reply.com" | |
- name: Deploy Hexo | |
run: | | |
hexo clean | |
hexo generate | |
hexo deploy |