Skip to content

Disable test actions for PRs (#237) #21

Disable test actions for PRs (#237)

Disable test actions for PRs (#237) #21

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@v3
- 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 -j$(nproc) -C build docs
make -j$(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@v3
with:
path: ${{ github.workspace }}/reference
name: reference-cache
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs: [generate-reference]
steps:
- uses: actions/checkout@v3
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.108.0'
extended: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Cache dependencies
uses: actions/cache@v3
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@v3
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@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# keep_files: true
publish_branch: gh-pages