[dropme] testing workflow #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Docs | |
| on: | |
| push: | |
| branches: | |
| - issue_667 | |
| # - master | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| refname: ${{ steps.extract_ref.outputs.refname }} | |
| is_tag: ${{ steps.extract_ref.outputs.is_tag }} | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract ref information | |
| id: extract_ref | |
| run: | | |
| REFNAME="${GITHUB_REF##*/}" | |
| echo "refname=$REFNAME" >> $GITHUB_OUTPUT | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| echo "is_tag=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_tag=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen make | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Conan | |
| run: | | |
| pip install conan | |
| mkdir -p ~/.conan2/profiles | |
| cp .github/workflows/conan/profiles/gcc11 ~/.conan2/profiles/default | |
| - name: Build documentation | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake -DCMAKE_BUILD_TYPE=Release -DH5CPP_LOCAL_MODULES=ON .. | |
| make html | |
| - name: Clone existing GitHub Pages content | |
| run: | | |
| git clone --depth=1 --branch gh-pages https://github.com/${{ github.repository }} gh-pages | |
| mkdir -p gh-pages/latest | |
| mkdir -p gh-pages/${{ steps.extract_ref.outputs.refname }} | |
| - name: Copy documentation to target directory | |
| run: | | |
| DEST="gh-pages/test" | |
| if [[ "${{ steps.extract_ref.outputs.is_tag }}" == "true" ]]; then | |
| DEST="gh-pages/${{ steps.extract_ref.outputs.refname }}" | |
| fi | |
| cp -r build/doc/build/* "$DEST" | |
| cp -r build/doc/doxygen_html "$DEST/api_reference/doxygen" || true | |
| cp build/doc/index.html "$DEST" || true | |
| - name: Upload GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: gh-pages | |
| deploy: | |
| needs: build-docs | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Configure GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |