Skip to content

Fix workflow: option for parallel in make and error in publish to PyP… #47

Fix workflow: option for parallel in make and error in publish to PyP…

Fix workflow: option for parallel in make and error in publish to PyP… #47

name: Build & Deploy Documentation
on:
push:
branches:
- master
jobs:
generate-reference:
runs-on: ubuntu-latest
container: sogno/dpsim:dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Build Environment
run: mkdir build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE
- name: Make reference docs
run: |
make --jobs $(nproc) -C build docs
make --jobs $(nproc) -C build docs_cxx
- name: Copy reference
run: |
mkdir reference
cp -r build/docs/sphinx/html/. reference/sphinx
cp -r build/docs/doxygen/html/. reference/doxygen
- name: Archive reference directory
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/reference
name: reference-cache
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs: [generate-reference]
steps:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.108.0'
extended: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: cd docs/hugo && npm ci
- run: cd docs/hugo && hugo --minify
- name: Restore reference archive
uses: actions/download-artifact@v4
with:
name: reference-cache
path: ${{ github.workspace }}/reference
- name: Copy docs
run: |
cp -r reference/. public
cp -r docs/hugo/public/. public
- name: Deploy page
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# keep_files: true
publish_branch: gh-pages