Skip to content

Commit

Permalink
迁移到 readthedocs
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims committed Feb 1, 2024
1 parent 0456cd9 commit 2f8f211
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 69 deletions.
59 changes: 1 addition & 58 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy_to_gitee
name: sync_to_gitee
on:
pull_request:
push:
Expand All @@ -10,52 +10,8 @@ concurrency:
cancel-in-progress: true

jobs:
build_and_commit:
if: ${{ !contains(github.event.head_commit.message, '[no deploy]') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Setup Python
uses: actions/setup-python@v5.0.0
with:
python-version: "3.11"

- name: Checkout sources
uses: actions/checkout@v4.1.1
with:
path: main
fetch-depth: 0

- name: Checkout docs
uses: actions/checkout@v4.1.1
with:
ref: docs
path: docs

- name: Install sphinx
shell: bash
run: |
pip install -r main/docs/requirements.txt
- name: Build docs
shell: bash
run: |
rm -rf docs/build
sphinx-build main/docs docs/build
- name: Commit changes
uses: EndBug/add-and-commit@v9.1.3
with:
cwd: docs
commit: "--amend"
push: "--force"
default_author: github_actions
message: "[bot] Build gitee pages"

sync:
runs-on: ubuntu-latest
needs: build_and_commit
steps:
- name: Sync to gitee.com
uses: wearerequired/git-mirror-action@v1.2.0
Expand All @@ -64,16 +20,3 @@ jobs:
with:
source-repo: git@github.com:FeignClaims/vscode_cpp_starter.git
destination-repo: git@gitee.com:cpp_tutorial/vscode_cpp_starter.git

publish:
runs-on: ubuntu-latest
needs: sync
steps:
- name: Build Gitee Pages
uses: yanglbme/gitee-pages-action@v1.4.2
with:
gitee-username: FeignClaims
gitee-password: ${{ secrets.GITEE_PASSWORD }}
gitee-repo: cpp_tutorial/vscode_cpp_starter
branch: docs
directory: build
16 changes: 16 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.12"
jobs:
post_checkout:
- git fetch --unshallow || true

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
8 changes: 0 additions & 8 deletions docs/_static/no_cache.js

This file was deleted.

5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
},
{
"name": "部署状态",
"url": "https://github.com/FeignClaims/vscode_cpp_starter/actions/workflows/ci.yml",
"icon": "https://github.com/FeignClaims/vscode_cpp_starter/actions/workflows/ci.yml/badge.svg",
"url": "https://readthedocs.org/projects/vscode-cpp-starter/",
"icon": "https://readthedocs.org/projects/vscode-cpp-starter/badge/?version=latest",
"type": "url",
}
],
Expand All @@ -71,4 +71,3 @@
def setup(app):
app.add_css_file("custom.css")
app.add_css_file("monofont.css")
app.add_js_file("no_cache.js")

0 comments on commit 2f8f211

Please sign in to comment.