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: Deploy DocC Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build Documentation | |
| run: | | |
| swift package --allow-writing-to-directory ./docs \ | |
| generate-documentation \ | |
| --target NavigationSplitViewKit \ | |
| --output-path ./docs \ | |
| --transform-for-static-hosting \ | |
| --hosting-base-path NavigationSplitView | |
| - name: Add .nojekyll and index redirect | |
| run: | | |
| touch docs/.nojekyll | |
| cat > docs/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Redirecting to NavigationSplitViewKit Documentation</title> | |
| <meta http-equiv="refresh" content="0; url=./documentation/navigationsplitviewkit/"> | |
| <link rel="canonical" href="./documentation/navigationsplitviewkit/"> | |
| </head> | |
| <body> | |
| <p>Redirecting to <a href="./documentation/navigationsplitviewkit/">NavigationSplitViewKit Documentation</a>...</p> | |
| <script>window.location.href = "./documentation/navigationsplitviewkit/";</script> | |
| </body> | |
| </html> | |
| EOF | |
| - name: Upload artifact | |
| if: github.event_name == 'push' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "./docs" | |
| deploy: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |