11name : deploy-book
2+ defaults :
3+ run :
4+ shell : bash -ieo pipefail {0}
25
36# Run this when the master or main branch changes
47on :
58 push :
69 branches :
710 - main
11+
812 # If your git repository has the Jupyter Book within some-subfolder next to
913 # unrelated files, you can make this run only if a file within that specific
1014 # folder has been modified.
1115 #
1216 # paths:
1317 # - some-subfolder/**
18+ pull_request :
19+ branches :
20+ - main
1421
1522# This job installs dependencies, builds the book, and pushes it to `gh-pages`
1623jobs :
1724 deploy-book :
1825 runs-on : ubuntu-latest
26+ container :
27+ image : " pycram/semantic_world:jazzy"
1928 permissions :
2029 pages : write
2130 id-token : write
2231 steps :
2332 - uses : actions/checkout@v4
24-
25- # Install dependencies
26- - name : Set up Python 3.10
27- uses : actions/setup-python@v5
2833 with :
29- python-version : ' 3.10'
30- cache : pip # Implicitly uses requirements.txt for cache key
31-
34+ path : " ros/src/semantic_world"
35+ repository : ${{ github.repository }}
36+ ref : ${{ github.ref }}
37+ submodules : ' false'
38+
39+ - name : Update semantic_world source files
40+ run : |
41+ rm -rf /opt/ros/overlay_ws/src/semantic_world/*
42+ cd /opt/ros/overlay_ws/src/semantic_world
43+ rm -rf .git .github .gitignore .gitmodules .readthedocs.yaml
44+ cp -r /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/ros/src/semantic_world /opt/ros/overlay_ws/src
45+
3246 - name : Install dependencies
3347 run : |
3448 sudo apt-get update
35- sudo apt install graphviz graphviz-dev
49+ cd /opt/ros/overlay_ws/src/semantic_world
50+ source ../semantic_world-venv/bin/activate
3651 pip install -U pip && pip install -r requirements.txt && pip install . && pip install -r doc/requirements.txt
3752
3853 # (optional) Cache your executed notebooks between runs
@@ -48,15 +63,19 @@ jobs:
4863 # Build the book
4964 - name : Build the book
5065 run : |
66+ cd /opt/ros/overlay_ws/src/semantic_world
67+ source ../semantic_world-venv/bin/activate
5168 jupyter-book build doc
5269
5370 # Upload the book's HTML as an artifact
5471 - name : Upload artifact
72+ if : github.event_name == 'push'
5573 uses : actions/upload-pages-artifact@v3
5674 with :
57- path : " doc/_build/html"
75+ path : " /opt/ros/overlay_ws/src/semantic_world/ doc/_build/html"
5876
5977 # Deploy the book's HTML to GitHub Pages
6078 - name : Deploy to GitHub Pages
79+ if : github.event_name == 'push'
6180 id : deployment
62- uses : actions/deploy-pages@v4
81+ uses : actions/deploy-pages@v4
0 commit comments