|
1 |
| -name: Upload docs to production |
| 1 | +name: Deploy API Docs |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | schedule:
|
|
7 | 7 | workflow_dispatch:
|
8 | 8 |
|
9 | 9 | jobs:
|
| 10 | + build: |
| 11 | + name: 'Build API Docs (${{ matrix.gazebo_distribution }})' |
| 12 | + runs-on: ubuntu-latest |
| 13 | + container: |
| 14 | + image: ubuntu:${{ matrix.ubuntu_distribution }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - ubuntu_distribution: focal |
| 20 | + gazebo_distribution: citadel |
| 21 | + |
| 22 | + - ubuntu_distribution: focal |
| 23 | + gazebo_distribution: fortress |
| 24 | + |
| 25 | + - ubuntu_distribution: focal |
| 26 | + gazebo_distribution: garden |
| 27 | + |
| 28 | + - ubuntu_distribution: jammy |
| 29 | + gazebo_distribution: harmonic |
| 30 | + steps: |
| 31 | + - uses: ros-tooling/[email protected] |
| 32 | + - name: 'Set up Gazebo' |
| 33 | + uses: gazebo-tooling/setup-gazebo@1f55cec330de851fa373f1ade8ac6b7ddfe6f013 |
| 34 | + with: |
| 35 | + required-gazebo-distributions: ${{ matrix.gazebo_distribution }} |
| 36 | + - name: 'Add Doxygen' |
| 37 | + run: sudo apt-get install -y doxygen graphviz |
| 38 | + - name: 'Add missing dependencies' |
| 39 | + run: sudo apt-get install -y libopengl-dev |
| 40 | + - name: 'Build Docs' |
| 41 | + run: | |
| 42 | + mkdir -p ws/src |
| 43 | + cd ws/src |
| 44 | + vcs import --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-${{ matrix.gazebo_distribution}}.yaml |
| 45 | + rm -rf sdformat |
| 46 | + rm -rf gz-tools |
| 47 | + 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' ' ') |
| 48 | + cd .. |
| 49 | + colcon build --merge-install --event-handlers console_cohesion+ --cmake-args -DBUILD_DOCS=ON -DBUILD_TESTING=OFF --cmake-target doc |
| 50 | + - uses: actions/upload-artifact@v4 |
| 51 | + if: always() |
| 52 | + with: |
| 53 | + name: api-docs-${{ matrix.gazebo_distribution }} |
| 54 | + path: ws/build/**/doxygen/html |
| 55 | + |
10 | 56 | upload:
|
11 | 57 | name: Upload docs to production
|
12 |
| - runs-on: ubuntu-20.04 |
| 58 | + needs: build |
| 59 | + runs-on: ubuntu-latest |
13 | 60 | permissions:
|
14 | 61 | id-token: write
|
15 | 62 | contents: read
|
16 | 63 | steps:
|
17 | 64 | - name: Checkout
|
18 |
| - uses: actions/checkout@v2 |
| 65 | + uses: actions/checkout@v4 |
19 | 66 | - name: Configure AWS Credentials
|
20 | 67 | id: creds
|
21 | 68 | uses: aws-actions/configure-aws-credentials@v4
|
22 | 69 | with:
|
23 | 70 | aws-region: us-east-1
|
24 | 71 | role-to-assume: arn:aws:iam::200670743174:role/github-oidc-deployment-gz-web-app
|
25 |
| - # Need to run ./build_docs.sh |
26 |
| - output-credentials: true |
| 72 | + - uses: actions/download-artifact@v4 |
| 73 | + id: download |
| 74 | + with: |
| 75 | + path: .api-docs |
| 76 | + pattern: api-docs-* |
| 77 | + merge-multiple: true |
| 78 | + - name: 'Restructure API Docs' |
| 79 | + run: python3 tools/restructure_doxygen_artifacts.py ${{steps.download.outputs.download-path}} .api-out |
| 80 | + - uses: actions/upload-artifact@v4 |
| 81 | + with: |
| 82 | + name: api-docs |
| 83 | + path: .api-out/* |
27 | 84 | - name: Run nightly upload
|
28 |
| - run: | |
29 |
| - cd tools && ./build_docs.sh all |
30 |
| - shell: bash |
31 |
| - env: |
32 |
| - GZ_VERSION_PASSWORD: ${{ secrets.GZ_VERSION_PASSWORD }} |
33 |
| - AWS_ACCESS_KEY_ID: ${{ steps.creds.outputs.aws-access-key-id }} |
34 |
| - AWS_SECRET_ACCESS_KEY: ${{ steps.creds.outputs.aws-secret-access-key }} |
35 |
| - AWS_SESSION_TOKEN: ${{ steps.creds.outputs.aws-session-token }} |
| 85 | + run: aws s3 sync .api-out/ s3://gazebosim.org/api/ |
36 | 86 | - name: Invalidate Cloudfront distribution
|
37 | 87 | run: |
|
38 | 88 | aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*' --region us-east-1
|
0 commit comments