Serve public landing as DocC bundle (index.docc) #34
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: Publish DocC | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v4 | |
| - name: Set up Swift | |
| uses: swift-actions/setup-swift@v2 | |
| with: | |
| swift-version: '6.2' | |
| - name: Build DocC (public landing only) | |
| run: | | |
| set -euo pipefail | |
| output_root="${GITHUB_WORKSPACE}/_site" | |
| rm -rf "${output_root}" | |
| mkdir -p "${output_root}" | |
| # Public site policy: | |
| # - This site is a *public hint* about Wrkstrm. | |
| # - Do NOT publish internal design-system/provisioned/private docs here. | |
| # Build ONLY the public landing DocC bundle. | |
| docc convert "index.docc" \ | |
| --output-path "${output_root}" \ | |
| --transform-for-static-hosting \ | |
| --hosting-base-path / | |
| # Root landing should go to the documentation index. | |
| echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=/documentation/index/"></head></html>' > "${output_root}/index.html" | |
| touch "${output_root}/.nojekyll" | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }}documentation/index/ | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: Print Deployed URL | |
| run: echo "Deployed to ${{ steps.deployment.outputs.page_url }}documentation/index/" |