Skip to content

Commit

Permalink
Merge pull request #1086 from dlyr/fix-deploy-doc
Browse files Browse the repository at this point in the history
[ci] fix deploy doc.
  • Loading branch information
dlyr authored Oct 9, 2024
2 parents d764c11 + 7378953 commit 151aa49
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
37 changes: 27 additions & 10 deletions .github/workflows/deploy-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ on:
workflow_call:
secrets:
REPO_ACCESS_TOKEN:
required: true
required: false
inputs:
deploy-on-gh-pages:
required: false
type: string
default: "true"

jobs:
deploy-doc-index:
runs-on: ubuntu-20.04
if: ${{ inputs.deploy-on-gh-pages == 'true' }}
runs-on: ubuntu-24.04
steps:
- name: Checkout remote head
uses: actions/checkout@master
Expand All @@ -22,8 +28,8 @@ jobs:
publish_dir: 'doc/index'
keep_files: true

deploy-doc:
runs-on: ubuntu-20.04
build-and-deploy-doc:
runs-on: ubuntu-24.04
steps:
- name: Prepare directories
run: |
Expand All @@ -36,11 +42,12 @@ jobs:
path: src/Radium-Engine
submodules: recursive
- name: pull updated repo (e.g. with new VERSION)
if: ${{ inputs.deploy-on-gh-pages == 'true' }}
run: git -C src/Radium-Engine pull origin ${{ github.event.ref }}
- name: Install packages
run : |
sudo apt-get install graphviz plantuml clang-9 libclang-9-dev
- name: Fetch recent doxygen (1.9.8)
sudo apt-get install graphviz plantuml
- name: Fetch recent doxygen
run: |
wget https://sourceforge.net/projects/doxygen/files/rel-1.12.0/doxygen-1.12.0.linux.bin.tar.gz -O doxygen.tar.gz
tar -zxvf doxygen.tar.gz -C doxygen --wildcards "*/bin"
Expand All @@ -52,24 +59,34 @@ jobs:
GITHUB_REF=${{ github.ref }}
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: extract-branch
- name: Configure Doc
- name: Configure and build doc
run: |
cd build/Radium-Engine
ls -lh ../../doxygen/bin/doxygen
../../doxygen/bin/doxygen -v
cmake ../../src/Radium-Engine/doc -DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT -DDOXYGEN_EXECUTABLE=../../doxygen/bin/doxygen
- name: Build Doc
run: |
export GITHUB_REF="${{ steps.extract-branch.outputs.branch }}"
cd build/Radium-Engine
cmake --build . --target RadiumDoc
# upload doc as artifact if not deployed
- name: Archive doc
if: ${{ inputs.deploy-on-gh-pages == 'false' }}
uses: actions/upload-artifact@v4
with:
name: doc
path: |
build/Radium-Engine/html/
- name: Fix badges github ref
if: ${{ inputs.deploy-on-gh-pages == 'true' }}
run: |
export GITHUB_REF="${{ steps.extract-branch.outputs.branch }}"
cd build/Radium-Engine
sed -i "s/\$(GITHUB_REF)/${GITHUB_REF}/g" html/index.html
- name: Git branch name
if: ${{ inputs.deploy-on-gh-pages == 'true' }}
id: git-branch-name
uses: EthanSK/git-branch-name-action@v1
- name: Deploy Doc
if: ${{ inputs.deploy-on-gh-pages == 'true' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.REPO_ACCESS_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ jobs:
macos: "false"
build-release: "false"
coverage: "true"
call-deploy-doc:
uses: ./.github/workflows/deploy-doc.yml
with:
deploy-on-gh-pages: "false"

0 comments on commit 151aa49

Please sign in to comment.