Skip to content

Documentation

Documentation #13

Workflow file for this run

name: Documentation
on:
workflow_run:
workflows: ["CI"]
types:
- completed
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
actions: read
concurrency:
group: 'pages'
cancel-in-progress: false
env:
MODULE_NAME: Convert
jobs:
build-docs:
name: Build documentation
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download module artifact from CI
if: ${{ github.event_name == 'workflow_run' }}
uses: actions/download-artifact@v4
with:
name: Convert-Module-Universal
path: Artifacts/
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build module (manual trigger only)
if: ${{ github.event_name == 'workflow_dispatch' }}
shell: pwsh
run: |
./build.ps1 -Rust -Build -Targets @('x86_64-unknown-linux-gnu')
mkdir -p src/Convert/Private/bin/x64
cp lib/target/x86_64-unknown-linux-gnu/release/libconvert_core.so src/Convert/Private/bin/x64/
./build.ps1 -PowerShell -Build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Cache PowerShell modules
uses: actions/cache@v4
with:
path: ~/.local/share/powershell/Modules
key: ${{ runner.os }}-psmodules-${{ hashFiles('install_modules.ps1') }}
- name: Install PowerShell modules
shell: pwsh
run: ./install_modules.ps1
- name: Generate function documentation
shell: pwsh
run: ./.build/Invoke-DocumentationGeneration.ps1 -Force
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Install MkDocs dependencies
run: pip install -r docs/requirements.txt
- name: Build MkDocs site
run: mkdocs build --strict
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site/
deploy-docs:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build-docs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4