-
Notifications
You must be signed in to change notification settings - Fork 124
96 lines (89 loc) · 3.26 KB
/
nightly-upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy API Docs
on:
schedule:
# UTC timezone
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
build:
name: 'Build API Docs (${{ matrix.gazebo_distribution }})'
runs-on: ubuntu-latest
container:
image: ubuntu:${{ matrix.ubuntu_distribution }}
strategy:
fail-fast: false
matrix:
include:
- ubuntu_distribution: focal
gazebo_distribution: citadel
- ubuntu_distribution: focal
gazebo_distribution: fortress
- ubuntu_distribution: focal
gazebo_distribution: garden
- ubuntu_distribution: jammy
gazebo_distribution: harmonic
- ubuntu_distribution: noble
gazebo_distribution: ionic
steps:
- uses: ros-tooling/[email protected]
- name: 'Set up Gazebo'
uses: gazebo-tooling/setup-gazebo@1f55cec330de851fa373f1ade8ac6b7ddfe6f013
with:
required-gazebo-distributions: ${{ matrix.gazebo_distribution }}
use-gazebo-nightly: ${{ matrix.gazebo_distribution == 'ionic'}}
- name: 'Add Doxygen'
run: sudo apt-get install -y doxygen graphviz texlive-latex-extra
- name: 'Add missing dependencies'
run: sudo apt-get install -y libopengl-dev
- name: 'Build Docs'
run: |
mkdir -p ws/src
cd ws/src
vcs import --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-${{ matrix.gazebo_distribution}}.yaml
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install $(sort -u $(find . -iname 'packages-'${{ matrix.ubuntu_distribution}}'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | tr '\n' ' ')
cd ..
colcon build --merge-install --event-handlers console_cohesion+ --cmake-args -DBUILD_DOCS=ON -DBUILD_TESTING=OFF --cmake-target doc
- uses: actions/upload-artifact@v4
if: always()
with:
name: api-docs-${{ matrix.gazebo_distribution }}
path: ws/build/**/doxygen/html
if-no-files-found: 'error'
include-hidden-files: 'true'
upload:
name: Upload docs to production
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
# Allow only one concurrent deployment between this and the deploy workflow.
concurrency:
group: pages
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
id: download
with:
path: .api-docs
pattern: api-docs-*
merge-multiple: true
- name: 'Restructure API Docs'
run: python3 tools/restructure_doxygen_artifacts.py ${{steps.download.outputs.download-path}} .api-out
- uses: actions/upload-artifact@v4
with:
name: api-docs
path: .api-out/*
if-no-files-found: 'error'
include-hidden-files: 'true'
- name: Commit
# The workflow upto this point is good for generating a preview,
# but only commit to deploy if we are on the master branch (not a pull request).
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.api-out
destination_dir: api
keep_files: true