mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
sphinx doc
This commit is contained in:
@@ -14,7 +14,11 @@ name: Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'doc/**'
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'doc/**'
|
||||
branches:
|
||||
- master
|
||||
- 'releases/*'
|
||||
|
||||
@@ -14,6 +14,8 @@ name: Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'doc/**'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
|
||||
@@ -14,6 +14,8 @@ name: Doc
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'docs/**'
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
name: "Build Sphinx Docs"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- docs
|
||||
- 'releases/*'
|
||||
tags:
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: ammaraskar/sphinx-action@master
|
||||
with:
|
||||
docs-folder: "doc/"
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: sphinx-docs
|
||||
path: doc/_build/html/
|
||||
- name: Commit documentation changes
|
||||
if: github.event_name != 'pull_request'
|
||||
run: |
|
||||
git clone https://github.com/v01d/incubator-nuttx.git --branch gh-pages --single-branch gh-pages
|
||||
cd gh-pages
|
||||
rm -rf ${GITHUB_REF##*/}
|
||||
mkdir -p ${GITHUB_REF##*/}
|
||||
cd ${GITHUB_REF##*/}
|
||||
cp -r ../../doc/_build/html/* .
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add .
|
||||
git commit -m "Update documentation" -a || true
|
||||
# The above command will fail if no changes were present, so we ignore
|
||||
# the return code.
|
||||
- name: Push changes
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
branch: gh-pages
|
||||
directory: gh-pages
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user