Merge pull request #575 from halotukozak-com/hover-documentation #260
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 static content to Pages | |
| on: | |
| push: | |
| tags: | |
| - "**" | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up JDK | |
| uses: actions/setup-java@v6 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Cache Mill dependencies | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.cache/coursier | |
| ~/.cache/mill | |
| key: ${{ runner.os }}-mill-${{ hashFiles('build.mill') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mill- | |
| - name: Generate docs | |
| run: ./mill jvm.docJar | |
| # Scaladoc's bundled ux.js still calls jQuery's `$.get` for its SPA-style same-page | |
| # navigation (sidebar/TOC link clicks), but scaladoc no longer ships jQuery itself. | |
| # That throws "ReferenceError: Can't find variable: $" on every in-page link click, | |
| # and since the handler already called preventDefault(), navigation just silently | |
| # breaks. Fixed upstream (scala/scala3#22014) but not yet in the scaladoc version | |
| # this project builds with -- swap the jQuery call for a native fetch() until then. | |
| - name: Patch scaladoc jQuery navigation bug | |
| run: | | |
| sed -i 's/\$\.get(href, function (data) {/fetch(href).then((r) => r.text()).then(function (data) {/' \ | |
| out/jvm/docJar.dest/docs/scripts/ux.js | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v6 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| # Upload entire repository | |
| path: 'out/jvm/docJar.dest/docs' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |