Skip to content

improve: 优化 base64 image 加载时的文件命名方式 (#216) #155

improve: 优化 base64 image 加载时的文件命名方式 (#216)

improve: 优化 base64 image 加载时的文件命名方式 (#216) #155

Workflow file for this run

name: Deploy Docs to GitHub Pages
on:
push:
branches:
- master
- docs_branch
jobs:
check-docs-changes:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.check_docs.outputs.changed }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for changes in docs directory
id: check_docs
run: |
if git diff --name-only HEAD^ HEAD | grep -q '^docs/'; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
deploy:
runs-on: ubuntu-latest
needs: check-docs-changes
if: ${{ needs.check-docs-changes.outputs.changed == 'true' }}
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs_requirements.txt
working-directory: ./docs
- name: Build and deploy docs
run: |
mkdocs build
working-directory: ./docs
- name: List current directory contents
run: |
ls -la
ls -la ./site
working-directory: ./docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.UPDATE_GH_PAGES }}
publish_dir: ./docs/site
- name: Deploy via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.REMOTE_PORT }}
source: "./docs/site"
target: ${{ secrets.REMOTE_DEST_PATH }}/../../