fix(tweedie-post): use plain PyTensor for logp and add timing #6
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: preview | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, closed] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| deploy-preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Build and deploy preview | |
| if: github.event.action != 'closed' | |
| run: | | |
| sed -i.bak "s|site_url:.*|site_url: https://williambdean.github.io/pr-${{ github.event.number }}/|" mkdocs.yml | |
| uv run mkdocs build | |
| mv mkdocs.yml.bak mkdocs.yml | |
| - name: Deploy to gh-pages | |
| if: github.event.action != 'closed' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./site | |
| destination_dir: pr-${{ github.event.number }} | |
| keep_files: true | |
| - name: Clean up preview on close | |
| if: github.event.action == 'closed' | |
| run: | | |
| git fetch origin gh-pages | |
| git checkout gh-pages | |
| rm -rf pr-${{ github.event.number }} | |
| git add -A | |
| git diff --quiet && git diff --staged --quiet || \ | |
| git -c user.name="github-actions[bot]" -c user.email="41898282+github-actions[bot]@users.noreply.github.com" \ | |
| commit -m "Clean up preview for PR #${{ github.event.number }}" | |
| git push origin gh-pages | |
| - name: Update PR body with preview URL | |
| if: github.event.action != 'closed' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const previewUrl = `https://williambdean.github.io/pr-${context.issue.number}/`; | |
| const previewSection = `\n---\n### Preview\n\nA live preview of this branch is deployed at: **[${previewUrl}](${previewUrl})**`; | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| }); | |
| let body = pr.body || ''; | |
| // Remove any existing preview section | |
| body = body.replace(/\n---\n### Preview\n.*?(?=\n---|$)/s, ''); | |
| await github.rest.pulls.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| body: body + previewSection, | |
| }); |