Skip to content
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

Link to preview deployments #58

Closed
KaiserKarel opened this issue May 19, 2023 · 1 comment · Fixed by #59
Closed

Link to preview deployments #58

KaiserKarel opened this issue May 19, 2023 · 1 comment · Fixed by #59
Assignees
Labels
A-ci Area: Our CI A-docs Area: documentation for any part of the project C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@KaiserKarel
Copy link
Contributor

If a PR alters the docs, we should do a preview deployment to vercel and show the preview URL in a comment. This should be possible by checking if nixbuild.net built the docs, or if it already had it in cache. If built, the docs should be fetched and uploaded.

This can be achieved with something like

run: |
  nix copy --from nixbuild.net $(type -p ./#docs)
  vercel build
  vercel deploy > url.txt
working-directory: docs  
continue-on-error: true    
run: |
  if test -f url.txt; then
    create comment
  fi

With this, we'll get links to previews only if the docs changed. A downside is that the nix store can remove cached docs if they haven't been built in a while. Alternatively we can also only run the preview URL if the docs directory is changed; but that however means that if docs depend on anything outside of the docs directory, we might build broken docs without knowing it.

@KaiserKarel KaiserKarel self-assigned this May 19, 2023
@KaiserKarel KaiserKarel added A-docs Area: documentation for any part of the project C-enhancement Category: An issue proposing an enhancement or a PR with one. A-ci Area: Our CI labels May 19, 2023
@KaiserKarel KaiserKarel linked a pull request May 19, 2023 that will close this issue
@KaiserKarel KaiserKarel reopened this May 19, 2023
@KaiserKarel
Copy link
Contributor Author

We're now showing preview URLs, but on every single pull_request. Next a check should be added to not preview if the input hash of main == hash of PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ci Area: Our CI A-docs Area: documentation for any part of the project C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant