Fixed branch name for generation. #3
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: Generate Documentation | |
| on: | |
| push: | |
| branches: | |
| - master # Run on every push to master, adjust as needed | |
| - making-docs | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| - name: Set up .NET SDK | |
| uses: actions/setup-dotnet@v2 | |
| with: | |
| dotnet-version: '6.x' # Ensure compatibility with DocFX | |
| - name: Install DocFX | |
| run: | | |
| wget https://github.com/dotnet/docfx/releases/download/v2.58/docfx.zip | |
| unzip docfx.zip -d docfx | |
| - name: Locate DocFX Path | |
| id: locate_docfx | |
| run: | | |
| DOCFX_PATH=$(find $GITHUB_WORKSPACE -name "docfx" -type f -executable | head -n 1) | |
| if [ -z "$DOCFX_PATH" ]; then | |
| echo "Error: DocFX not found." | |
| exit 1 | |
| fi | |
| echo "DOCFX_PATH=$DOCFX_PATH" >> $GITHUB_ENV | |
| chmod +x $DOCFX_PATH # Ensure executable permissions | |
| - name: Set Permissions for docfx.json | |
| run: chmod +r docfx_project/docfx.json # Place this step here to set permissions | |
| - name: Generate Documentation | |
| run: | | |
| $DOCFX_PATH docfx_project/docfx.json | |
| - name: Publish to GitHub Wiki | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.DOCS_TOKEN }} | |
| publish_dir: docfx_project/site | |
| publish_branch: 'wiki' # Pushes directly to the wiki branch |