Documentation #17
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: 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@34e114876b0b11c390a56381ad16ebd13914f8d5 | |
| - name: Download module artifact from CI | |
| if: ${{ github.event_name == 'workflow_run' }} | |
| uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e | |
| 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@983d7736d9b0ae728b81ab479565c72886d7745b | |
| - name: Cache PowerShell modules | |
| uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 | |
| 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@a26af69be951a213d495a4c3e4e4022e16d87065 | |
| 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@56afc609e74202658d3ffba0e8f6dda462b719fa | |
| 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@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e |