Skip to content

Commit 88d623b

Browse files
Move PX4 Guide source into /docs (#24490)
* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <[email protected]> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <[email protected]> * ci: update runners Signed-off-by: Ramon Roche <[email protected]> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <[email protected]> Co-authored-by: Ramon Roche <[email protected]>
1 parent 8e6d2eb commit 88d623b

File tree

5,176 files changed

+520095
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,176 files changed

+520095
-2
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Makefile.* text eol=lf
7272
*.tar binary
7373
*.tgz binary
7474
*.zip binary
75+
*.hex binary
7576

7677
# everything else
7778
.gitattributes text eol=lf

.github/workflows/build_all_targets.yml

+6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ on:
1414
- 'stable'
1515
- 'beta'
1616
- 'release/**'
17+
paths-ignore:
18+
- 'docs/**'
19+
- '.github/**'
1720
pull_request:
1821
branches:
1922
- '*'
23+
paths-ignore:
24+
- 'docs/**'
25+
- '.github/**'
2026

2127
jobs:
2228
group_targets:

.github/workflows/checks.yml

+6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ on:
44
push:
55
branches:
66
- 'main'
7+
paths-ignore:
8+
- 'docs/**'
9+
- '.github/**'
710
pull_request:
811
branches:
912
- '*'
13+
paths-ignore:
14+
- 'docs/**'
15+
- '.github/**'
1016

1117
jobs:
1218
build:

.github/workflows/clang-tidy.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ on:
44
push:
55
branches:
66
- 'main'
7+
paths-ignore:
8+
- 'docs/**'
9+
- '.github/**'
710
pull_request:
811
branches:
912
- '*'
10-
13+
paths-ignore:
14+
- 'docs/**'
15+
- '.github/**'
1116
jobs:
1217
build:
1318
runs-on: ubuntu-latest

.github/workflows/compile_macos.yml

+6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ on:
44
push:
55
branches:
66
- 'main'
7+
paths-ignore:
8+
- 'docs/**'
9+
- '.github/**'
710
pull_request:
811
branches:
912
- '*'
13+
paths-ignore:
14+
- 'docs/**'
15+
- '.github/**'
1016

1117
jobs:
1218
build:

.github/workflows/compile_ubuntu.yml

+6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ on:
77
- 'stable'
88
- 'beta'
99
- 'release/**'
10+
paths-ignore:
11+
- 'docs/**'
12+
- '.github/**'
1013
pull_request:
1114
branches:
1215
- '*'
16+
paths-ignore:
17+
- 'docs/**'
18+
- '.github/**'
1319

1420
jobs:
1521
build_and_test:

.github/workflows/dev_container.yml

+6
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ on:
1010
- 'release/**'
1111
tags:
1212
- 'v*'
13+
paths-ignore:
14+
- 'docs/**'
15+
- '.github/**'
1316
pull_request:
1417
branches:
1518
- '*'
19+
paths-ignore:
20+
- 'docs/**'
21+
- '.github/**'
1622

1723
jobs:
1824
build:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Docs - Crowdin - Download Guide Translations
2+
3+
# https://github.com/crowdin/github-action/tree/master
4+
5+
on:
6+
schedule:
7+
- cron: '0 0 * * 0' # Runs every Sunday at 00:00 UTC
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
synchronize-with-crowdin:
16+
name: Synchronize with Crowdin
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
max-parallel: 1 # Should be 1 to avoid parallel builds
21+
matrix:
22+
lc: [ko, uk, zh] # Target languages https://developer.crowdin.com/language-codes/
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Matrix
28+
uses: crowdin/github-action@v2
29+
with:
30+
config: 'docs/crowdin.yml'
31+
upload_sources: false
32+
upload_translations: false
33+
download_translations: true
34+
commit_message: New Crowdin translations - ${{ matrix.lc }}
35+
localization_branch_name: l10n_crowdin_docs_translations_${{ matrix.lc }}
36+
crowdin_branch_name: main
37+
create_pull_request: true
38+
pull_request_base_branch_name: 'main'
39+
pull_request_title: New PX4 guide translations (Crowdin) - ${{ matrix.lc }}
40+
pull_request_body: 'New PX4 guide Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action) for ${{ matrix.lc }}'
41+
download_language: ${{ matrix.lc }}
42+
env:
43+
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
44+
GITHUB_TOKEN: ${{ secrets.PX4BUILDBOT_ACCESSTOKEN }}
45+
46+
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
47+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_DOCS_PROJECT_ID }}
48+
49+
# Visit https://crowdin.com/settings#api-key to create this token
50+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.PX4BUILDBOT_CROWDIN_PERSONAL_TOKEN }}
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Docs - Crowdin - Upload Guide sources (en)
2+
3+
# https://github.com/crowdin/github-action/tree/master
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'docs/en/**'
11+
pull_request:
12+
types:
13+
- closed
14+
branches:
15+
- main
16+
paths:
17+
- 'docs/en/**'
18+
workflow_dispatch:
19+
20+
jobs:
21+
upload-to-crowdin:
22+
if: github.event.pull_request.merged == true || github.event_name == 'push'
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: crowdin push
29+
uses: crowdin/github-action@v2
30+
with:
31+
config: 'docs/crowdin.yml'
32+
upload_sources: true
33+
upload_translations: false
34+
download_translations: false
35+
crowdin_branch_name: main
36+
env:
37+
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
38+
GITHUB_TOKEN: ${{ secrets.PX4BUILDBOT_ACCESSTOKEN }}
39+
40+
# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
41+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_DOCS_PROJECT_ID }}
42+
43+
# Visit https://crowdin.com/settings#api-key to create this token
44+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.PX4BUILDBOT_CROWDIN_PERSONAL_TOKEN }}

.github/workflows/docs_deploy.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Docs - Deploy PX4 User Guide
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'release/**'
8+
tags:
9+
- 'v*'
10+
paths:
11+
- 'docs/en/**'
12+
pull_request:
13+
branches:
14+
- '*'
15+
paths:
16+
- 'docs/en/**'
17+
18+
# Allows you to run this workflow manually from the Actions tab
19+
workflow_dispatch:
20+
21+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
22+
permissions:
23+
contents: read
24+
pages: write
25+
id-token: write
26+
27+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
28+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
29+
concurrency:
30+
group: pages
31+
cancel-in-progress: false
32+
33+
env:
34+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
35+
36+
jobs:
37+
build:
38+
runs-on: [runs-on,runner=8cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false,extras=s3-cache]
39+
steps:
40+
- uses: runs-on/action@v1
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Setup Node
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 20
48+
cache: npm
49+
# Specify the path to lock file for correct caching
50+
cache-dependency-path: ./docs/yarn.lock
51+
52+
- name: Install dependencies
53+
run: yarn install --frozen-lockfile --cwd ./docs
54+
55+
- name: Build with VitePress
56+
working-directory: ./docs
57+
run: |
58+
npm run docs:build_ubuntu
59+
touch .vitepress/dist/.nojekyll
60+
npm run docs:sitemap
61+
62+
- name: Upload artifact
63+
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged) || github.event_name == 'workflow_dispatch' }}
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: px4_docs_build
67+
path: docs/.vitepress/dist/
68+
retention-days: 1
69+
70+
deploy:
71+
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged) || github.event_name == 'workflow_dispatch' }}
72+
needs: build
73+
runs-on: [runs-on,runner=2cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
74+
75+
steps:
76+
- name: Download Artifact
77+
uses: actions/download-artifact@v4
78+
with:
79+
name: px4_docs_build
80+
path: ~/_book
81+
82+
- name: Deploy
83+
run: |
84+
git clone --single-branch --branch main https://${{ secrets.PX4BUILTBOT_PERSONAL_ACCESS_TOKEN }}@github.com/PX4/docs.px4.io.git
85+
rm -rf docs.px4.io/${BRANCH_NAME}
86+
mkdir -p docs.px4.io/${BRANCH_NAME}
87+
cp -r ~/_book/* docs.px4.io/${BRANCH_NAME}/
88+
cd docs.px4.io
89+
git config --global user.name "${{ secrets.PX4BUILDBOT_USER }}"
90+
git config --global user.email "${{ secrets.PX4BUILDBOT_EMAIL }}"
91+
git add ${BRANCH_NAME}
92+
git commit -a -m "PX4 docs build update (vitepress) `date`"
93+
#git add .
94+
#git commit --amend -m "PX4 docs build update (vitepress) `date`"
95+
#git commit --allow-empty -m "Empty commit to force rebuild"
96+
git push origin main -f
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Docs - Check for flaws in PX4 Guide Source
2+
# So far:
3+
# Modifications of translations files
4+
# Broken internal links
5+
6+
on:
7+
pull_request_target:
8+
types: [opened, edited, synchronize]
9+
paths:
10+
- 'docs/en/**'
11+
12+
jobs:
13+
check_flaws:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
21+
- name: Install Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: '16'
25+
26+
- name: Create logs directory
27+
run: |
28+
mkdir logs
29+
30+
- name: Get changed english files
31+
id: get_changed_markdown_english
32+
uses: tj-actions/[email protected]
33+
with:
34+
json: true
35+
base_sha: "${{ github.event.pull_request.base.sha }}"
36+
sha: "${{ github.event.pull_request.head.sha }}"
37+
# Below are used to output files to a directory. May use in flaw checker.
38+
# write_output_files: true
39+
# output_dir: "./logs"
40+
files: |
41+
docs/en/**/*.md
42+
43+
- name: Save JSON file containing files to link check
44+
run: |
45+
echo "${{ steps.get_changed_markdown_english.outputs.all_changed_files }}"
46+
echo "${{ steps.get_changed_markdown_english.outputs.all_changed_files }}" > ./logs/prFiles.json
47+
48+
- name: Run link checker
49+
id: link-check
50+
run: |
51+
npm -g install [email protected]
52+
markdown_link_checker_sc -r ${{ github.workspace }} -d en -f ./docs/logs/prFiles.json -i assets -u docs.px4.io/main/ > ./docs/logs/errorsFilteredByPrPages.md
53+
mkdir -p ./pr
54+
cp ./docs/logs/errorsFilteredByPrPages.md ./pr/errorsFilteredByPrPages.md
55+
56+
- name: Read errorsFilteredByPrPages.md file
57+
id: read-errors-by-page
58+
uses: juliangruber/read-file-action@v1
59+
with:
60+
path: ./logs/errorsFilteredByPrPages.md
61+
62+
- name: Echo Errors by Page
63+
run: echo "${{ steps.read-errors-by-page.outputs.content }}"
64+
65+
- name: Save PR number
66+
env:
67+
PR_NUMBER: ${{ github.event.number }}
68+
run: |
69+
#mkdir -p ./pr
70+
echo $PR_NUMBER > ./pr/pr_number
71+
- uses: actions/upload-artifact@v4
72+
with:
73+
name: pr_number
74+
path: pr/

.github/workflows/ekf_functional_change_indicator.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches:
66
- '*'
7+
paths-ignore:
8+
- 'docs/**'
9+
- '.github/**'
710

811
jobs:
912
unit_tests:

.github/workflows/ekf_update_change_indicator.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: EKF Update Change Indicator
22

3-
on: push
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '.github/**'
48

59
jobs:
610
unit_tests:

0 commit comments

Comments
 (0)