CI: Update actions #23
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: Docs | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["master"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Install dependencies | |
run: | | |
# Install sphinx | |
pip install sphinx sphinx_rtd_theme | |
# Install ROS packages | |
sudo apt install -y python3-rospy python3-rostopic python3-rosservice python3-actionlib \ | |
ros-message-generation libstd-msgs-dev librostest-dev catkin | |
# Setup and build catkin workspace | |
mkdir -p /tmp/ros/src | |
ln -s $PWD /tmp/ros/src/pyhsm | |
git clone https://github.com/ubi-agni/pyhsm_msgs.git /tmp/ros/src/pyhsm_msgs | |
catkin_make_isolated -C /tmp/ros | |
- name: Sphinx build | |
run: | | |
source /tmp/ros/devel_isolated/setup.bash | |
sphinx-build -W doc _site | |
- name: Validate links | |
run: | | |
source /tmp/ros/devel_isolated/setup.bash | |
sphinx-build -W -b linkcheck doc _site | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
# Deployment job | |
deploy: | |
if: github.ref == 'refs/heads/master' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |