Skip to content

[faq] 更正运算符重载决策措辞 #15

[faq] 更正运算符重载决策措辞

[faq] 更正运算符重载决策措辞 #15

name: deploy_gitee_pages
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
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 gitee_docs
uses: actions/checkout@v4.1.1
with:
ssh-key: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
ref: gitee_docs
path: gitee_docs
- name: Replace vscode-cpp-starter.readthedocs.io/ to cpp_tutorial.gitee.io/vscode_cpp_starter/
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "main/conf.py"
find: '"https://vscode-cpp-starter.readthedocs.io/"'
replace: '"https://cpp_tutorial.gitee.io/vscode_cpp_starter/"'
regex: false
- name: Replace change-major-exam.readthedocs.io/ to cpp_tutorial.gitee.io/change_major_exam/
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "main/conf.py"
find: '"https://change-major-exam.readthedocs.io/"'
replace: '"https://cpp_tutorial.gitee.io/change_major_exam/"'
regex: false
- name: Show mirror website
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "main/index.rst"
find: "`本网站的国内网址 (不支持搜索) <https://cpp_tutorial.gitee.io/board/>`_"
replace: "`本网站的国外主网址 (支持搜索) <https://question-board.readthedocs.io/>`_"
regex: false
- name: Install sphinx
shell: bash
run: |
pip install -r main/requirements.txt
- name: Build docs
shell: bash
run: |
rm -rf gitee_docs/build
sphinx-build main gitee_docs/build
- name: Commit changes
uses: EndBug/add-and-commit@v9.1.3
with:
cwd: gitee_docs
commit: "--amend"
push: "--force"
default_author: github_actions
message: "[bot] Build gitee pages"
publish:
runs-on: ubuntu-latest
needs: build_and_commit
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/board
branch: gitee_docs
directory: build