Update ci.yml #5
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: ci | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- run: pip install mkdocs | |
- run: pip install mkdocs-material | |
- run: pip install mkdocs-blogging-plugin | |
- run: pip install mkdocs-git-revision-date-localized-plugin | |
- run: pip install mkdocs-glightbox | |
- run: pip install mkdocs-pdf | |
- name: Install SSH Client #步骤3:关联ssh私钥 | |
uses: webfactory/[email protected] #这里调用这个第三方的库,可以直接关联ssh私钥 | |
with: #下面是参数 | |
#这里需要通过github的环境参数中获取私钥,并传给这个库,(这是最安全的,git当然不能让用户直接输入私钥内容) | |
ssh-private-key: ${{ secrets.MKDOCS_SERVER }} | |
- run: mkdocs gh-deploy --force |