Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Continuous Deployment

on:
push:
branches: [ main ]

jobs:
deploy-docs:
runs-on: ubuntu-latest
concurrency: deploy-${{ github.ref }}
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.10"

- name: Set up env
run: uv sync --all-extras --frozen

- name: Copy notebooks to docs folder
run: cp -r notebooks/* docs/notebooks

- run: |
uv run ipython kernel install --user --name=behavior_generation_lecture
uv run mkdocs gh-deploy --force
51 changes: 27 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Continuous Integration and Deployment
name: Continuous Integration

on:
push:
branches: [ main ]
Expand All @@ -7,8 +8,11 @@ on:
- cron: "0 3 * * 1" # Run every Monday 3 am

jobs:
test:
ci:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: actions/checkout@v4

Expand All @@ -21,7 +25,7 @@ jobs:
run: sudo apt install python3-tk -y

- name: Set up env
run: uv sync --all-extras
run: uv sync --all-extras --frozen

- name: Run ruff format
run: uv run ruff format
Expand All @@ -47,32 +51,31 @@ jobs:
- name: Copy notebooks to docs folder
run: cp -r notebooks/* docs/notebooks

- name: Build docs
- name: Build PR docs (including running the notebooks)
run: |
sed -i "s/^site_name:.*$/site_name: 'Behavior Generation Lecture - tmp docs for PR ${{ github.event.pull_request.number }}'/" mkdocs.yml
uv run ipython kernel install --user --name=behavior_generation_lecture
uv run mkdocs build
uv run mkdocs build --site-dir site/pr-${{ github.event.pull_request.number }}

deploy-pages:
runs-on: ubuntu-latest
needs: [test]
if: github.ref == 'refs/heads/main'
concurrency: deploy-${{ github.ref }}
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Deploy PR docs
if: github.event_name == 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
version: "0.5.10"
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/pr-${{ github.event.pull_request.number }}
destination_dir: pr-${{ github.event.pull_request.number }} # Deploy to subdirectory
publish_branch: gh-pages
keep_files: true # Retain other content on gh-pages

- name: Add PR note
if: github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
message: |
### :books: Docs

- name: Set up env
run: uv sync --all-extras
Created [temporary docs](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr-${{ github.event.pull_request.number }}/).

- name: Copy notebooks to docs folder
run: cp -r notebooks/* docs/notebooks

- run: |
uv run ipython kernel install --user --name=behavior_generation_lecture
uv run mkdocs gh-deploy --force


1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nav:
- Decision Making:
- Value Iteration: notebooks/mdp_value_iteration.ipynb
- Q-Learning: notebooks/mdp_q_learning.ipynb
- Policy Gradient: notebooks/mdp_policy_gradient.ipynb
- API Documentation (partial): reference/

plugins:
Expand Down
4 changes: 2 additions & 2 deletions notebooks/a_star_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "behavior_generation_lecture",
"language": "python",
"name": "python3"
"name": "behavior_generation_lecture"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions notebooks/lateral_control_state_based_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
"hash": "ea80bdc8d9eecdfb0ad4850befec70bcf98ec6f56b32ef8090165e65e0e9c093"
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "behavior_generation_lecture",
"language": "python",
"name": "python3"
"name": "behavior_generation_lecture"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions notebooks/mdp_policy_gradient.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "behavior_generation_lecture",
"language": "python",
"name": "python3"
"name": "behavior_generation_lecture"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions notebooks/mdp_q_learning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "behavior_generation_lecture",
"language": "python",
"name": "python3"
"name": "behavior_generation_lecture"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions notebooks/mdp_value_iteration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "behavior_generation_lecture",
"language": "python",
"name": "python3"
"name": "behavior_generation_lecture"
},
"language_info": {
"codemirror_mode": {
Expand Down
Loading