1
+ name : Docs
2
+ on :
3
+ push :
4
+ branches : [feature/add_doc_job]
5
+ permissions :
6
+ contents : read
7
+ pages : write
8
+ id-token : write
9
+ concurrency :
10
+ group : deploy
11
+ cancel-in-progress : false
12
+ env :
13
+ CARGO_TERM_COLOR : always
14
+ jobs :
15
+ build :
16
+ name : Build
17
+ runs-on : ubuntu-latest
18
+ container : rostooling/setup-ros-docker:ubuntu-jammy-ros-rolling-ros-base-latest
19
+ steps :
20
+ - name : Checkout repository
21
+ uses : actions/checkout@v4
22
+ # ROS 2 WS part
23
+ - name : Search packages in this repository
24
+ id : list_packages
25
+ run : |
26
+ {
27
+ echo 'package_list<<EOF'
28
+ colcon list --names-only
29
+ echo EOF
30
+ } >> "$GITHUB_OUTPUT"
31
+ - name : Setup ROS environment
32
+ uses :
ros-tooling/[email protected]
33
+ with :
34
+ required-ros-distributions : rolling
35
+ - name : Setup Rust
36
+ uses : dtolnay/rust-toolchain@stable
37
+ with :
38
+ components : clippy, rustfmt
39
+ - name : Install colcon-cargo and colcon-ros-cargo
40
+ run : |
41
+ sudo pip3 install git+https://github.com/colcon/colcon-cargo.git
42
+ sudo pip3 install git+https://github.com/colcon/colcon-ros-cargo.git
43
+ - name : Build ROS 2 WS
44
+ id : build_ros_ws
45
+ uses :
ros-tooling/[email protected]
46
+ with :
47
+ package-name : ${{ steps.list_packages.outputs.package_list }}
48
+ target-ros2-distro : rolling
49
+ vcs-repo-file-url : ros2_rust_rolling.repos
50
+ skip-tests : true
51
+ # DOC part
52
+ - name : Setup pages
53
+ id : pages
54
+ uses : actions/configure-pages@v5
55
+ - name : Build docs
56
+ run : |
57
+ cd ${{ steps.build_ros_ws.outputs.ros-workspace-directory-name }}
58
+ . install/setup.sh
59
+ cd $(colcon list | awk '$1 == "rclrs" { print $2 }')
60
+ cargo doc --no-deps
61
+ - name : Add redirect
62
+ working-directory : ${{ steps.build_ros_ws.outputs.ros-workspace-directory-name }}/src/ros2_rust/rclrs
63
+ run : echo '<meta http-equiv="refresh" content="0;url=rclrs/index.html">' > target/doc/index.html
64
+ - name : Upload artifact
65
+ uses : actions/upload-pages-artifact@v3
66
+ with :
67
+ path : ${{ steps.build_ros_ws.outputs.ros-workspace-directory-name }}/src/ros2_rust/rclrs/target/doc
68
+ deploy :
69
+ name : Deploy
70
+ environment :
71
+ name : github-pages
72
+ url : ${{ steps.deployment.outputs.page_url }}
73
+ runs-on : ubuntu-latest
74
+ needs : build
75
+ steps :
76
+ - name : Deploy to GitHub Pages
77
+ id : deployment
78
+ uses : actions/deploy-pages@v4
0 commit comments