major cleanup and refactoring #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate and Publish Docs | |
on: | |
push: | |
branches: | |
- main # Replace with your default branch | |
pull_request: | |
jobs: | |
generate-docs: | |
name: Build and Deploy Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup ROS 2 | |
uses: ros-tooling/setup-ros@v0.4 | |
with: | |
distribution: jazzy | |
install-packages: python3-rosdoc2 | |
- name: Install rosdoc2 | |
run: sudo apt-get update && sudo apt-get install -y python3-rosdoc2 | |
- name: Discover ROS 2 Packages | |
id: discover-packages | |
run: | | |
colcon list --paths-only > packages.txt | |
- name: Generate Documentation for Each Package | |
run: | | |
mkdir -p docs_output | |
while read -r package_path; do | |
rosdoc2 build --package-path "$package_path" --output-directory "docs_output/" | |
done < packages.txt | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs_output |