Versioned docs #31
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: Versioned docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: ["*"] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Build | |
| run: | | |
| pushd docs | |
| pnpm install | |
| pnpm run build | |
| sudo apt-get install -y ripgrep | |
| rg '(src|href)="/' dist -l -0 | xargs -0 -n 1 sed -i 's#\(src\|href\)="/#\1="/${{github.ref_name}}/#g' | |
| mkdir -p versioned | |
| mv dist versioned/${{github.ref_name}} | |
| popd | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-${{github.ref_name}} | |
| path: ./docs/versioned | |
| overwrite: true |