ALD-24: Prevent file name collisions #25
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
| # Yoinked from: https://danielsaidi.com/blog/2024/03/10/automatically-publish-docc-to-github-pages-with-github-actions | |
| name: DocC Runner | |
| on: | |
| push: | |
| branches: ["main"] | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| # A single job that builds and deploys the DocC documentation | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Select Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '16.2.0' | |
| - name: Build DocC | |
| run: | | |
| xcodebuild clean -scheme "MCMap" -derivedDataPath /tmp/docbuild -destination "generic/platform=macOS" | |
| xcodebuild docbuild -scheme "MCMap" -derivedDataPath /tmp/docbuild -destination 'generic/platform=macOS' -skipPackagePluginValidation CODE_SIGNING_ALLOWED=NO; | |
| $(xcrun --find docc) process-archive \ | |
| transform-for-static-hosting /tmp/docbuild/Build/Products/Debug/MCMap.doccarchive \ | |
| --output-path docs \ | |
| --hosting-base-path '.'; | |
| echo "<script>window.location.href += \"/documentation/mcmap\"</script>" > docs/index.html; | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'docs' | |
| - id: deployment | |
| name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |