Merge pull request #49 from PTCInc/Endpoint-Resolver-Issue #50
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
| # Your GitHub workflow file under .github/workflows/ | |
| # Trigger the action on push to main | |
| name: Docfx Builder and Publisher for Web Pages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - 'Kepware.Api/**' | |
| - 'Kepware.Api.Sample/**' | |
| - 'KepwareSync.Service/**' | |
| - 'docs/docfx/**' | |
| - '.github/workflows/dotnet.yml' | |
| # - '!**/*.md' Exclude markdown files | |
| # pull_request: | |
| # branches: [ "main" ] | |
| # paths: | |
| # - 'Kepware.Api/**' | |
| # - 'Kepware.Api.Sample/**' | |
| # - 'KepwareSync.Service/**' | |
| # - '.github/workflows/dotnet.yml' | |
| # - '!*.md' # Exclude markdown files | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| actions: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| publish-docs: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
| - uses: dotnet/nbgv@master | |
| id: nbgv | |
| with: | |
| setAllVars: true | |
| - name: Dotnet Setup | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.x | |
| # Updates repo README.md to be index page for website | |
| - name: Modify markdown file to be index page | |
| run: | | |
| sed -i '1i ---\noutputFileName: index.html\n---' ./README.md | |
| # Copys markdown files to docfx folder to be used in docfx build | |
| - name: Run markdown copy script | |
| run: ./docs/docfx/copy_md_files.ps1 | |
| - run: cp ./README.md ./docs/docfx/ | |
| - run: dotnet tool update -g docfx | |
| - run: docfx ./docs/docfx/docfx.json | |
| - name: Upload artifact | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| # Upload entire repository | |
| path: './docs/docfx/_site' | |
| - name: Deploy to GitHub Pages | |
| if: github.event_name != 'pull_request' | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |