Skip to content

Add preview build functionality for PRs #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dcherian opened this issue Jun 13, 2022 · 3 comments
Closed

Add preview build functionality for PRs #68

dcherian opened this issue Jun 13, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@dcherian
Copy link
Contributor

No description provided.

@scottyhq
Copy link
Contributor

scottyhq commented Jun 13, 2022

We've been using Netlify for this on other projects https://jupyterbook.org/publish/netlify.html, and it is very nice to have

It's free, but requires an email account to setup and charges a subscription for multiple team members. So we have an "uwhackweeskaccount"@gmail.com account that several people have access to. I could add the site under that same account for now or does xarray already have an email account like that for other services?

Netlify requires a bit of manual setup to connect the github app (probably similar to reviewNB), but then the action for PRs is pretty straightforward
https://github.com/uwhackweek/jupyterbook-template/blob/main/.github/workflows/netlifypreview.yaml

    - name: Deploy Website Preview
      uses: nwtgck/actions-netlify@v1.1
      with:
        publish-dir: './book/_build/html'
        production-deploy: false
        github-token: ${{ secrets.GITHUB_TOKEN }}
        deploy-message: "Deploy from GitHub Actions"
        enable-commit-comment: false
        enable-pull-request-comment: true
        overwrites-pull-request-comment: true
        alias: deploy-preview-${{ github.event.number }}
      env:
        NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
        NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
      timeout-minutes: 1

here is a simple example where each PR gets a URL to review snowex-hackweek/website-2022#23, after a certain amount of space is used up those URLs start to get overwritten i think

@scottyhq
Copy link
Contributor

I should clarify, the above approach is for when JupyterBook is built via github actions as is currently done. Other hosting options have integrated PR previews via GitHub Apps. But the drawback as far as I understand is that the build happens on external resources (Read-The-Docs, Netlify) rather than via the GitHub interface on the more configurable Actions runners.

@scottyhq scottyhq added the enhancement New feature or request label Jun 17, 2022
@dcherian dcherian mentioned this issue Jun 2, 2023
34 tasks
@dcherian
Copy link
Contributor Author

Closed by #175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants