Merge pull request #3 from sktime/part2 #8
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: Quarto Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| tags: [v*] | |
| workflow_dispatch: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| actions: write | |
| contents: write # needed for gh-pages | |
| jobs: | |
| build-book: | |
| name: Build and Deploy Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ".[dev]" | |
| - name: Set PYTHONPATH | |
| run: echo "PYTHONPATH=$GITHUB_WORKSPACE/src" >> $GITHUB_ENV | |
| - name: Install Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Check Quarto installation | |
| run: | | |
| quarto check | |
| - name: Render Quarto site | |
| uses: quarto-dev/quarto-actions/render@v2 | |
| with: | |
| to: html # If set, it will be equivalent to `quarto render --to html` | |
| path: book | |
| # Deploy Preview for PRs | |
| - name: Publish PR Preview | |
| if: github.event_name == 'pull_request' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./book/_site | |
| destination_dir: previews/PR${{ github.event.number }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Deploy Dev Site from main | |
| - name: Publish Dev Site | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./book/_site | |
| destination_dir: dev | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Deploy Versioned Release | |
| - name: Publish Versioned Site | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./book/_site | |
| destination_dir: ${{ github.ref_name }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create 'latest' alias for stable release | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') | |
| run: | | |
| version="${GITHUB_REF#refs/tags/}" | |
| echo "Detected version: $version" | |
| mkdir -p ./latest | |
| cp -r ./book/_site/* ./latest/ | |
| - name: Publish stable release to 'latest' | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref_name, '-') | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./latest | |
| destination_dir: latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |