Help setting up pr-previews #48
-
Hey I am trying to use pr-previews for one of my projects - compressed-sensing/algorithms#11 I want my production website I also want multiple prs to have previews available along with the production website running so that we can compare. Could you help me out? I think its doable with your action but Im struggling to set it up |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The answer to this depends on what you mean by 'website'. The default use case is that your main deployment lives in the root directory on the If you want an entire other domain for your preview (e.g. compressed-sensing-algorithms-pr-preview-XX.github.io), GitHub Pages doesn't really support that - you can only have one GitHub Pages site per organisation, so you'll need to make a new organisation account on GitHub just for that website. That doesn't make much sense to me. If you want a completely isolated environment for your previews, it might make sense to use a totally seperate service for those deployments, like Vercel or Netlify. I think you just want to make sure that you can use this Action to have multiple PR previews and your main deployment on the same branch at the same time. If so, the answer to that question is yes you can; that's the whole point of this action. |
Beta Was this translation helpful? Give feedback.
-
Hey @rossjrw I really liked how the action worked and I wanted to apply it to other projects of mine. Here is a PR for a repository that I have raised from a forked copy https://github.com/m2lines/L96_demo/actions/runs/4894707073/jobs/8739302543?pr=111 as you can see in the logs, it fails due to we found that if the same code is written and raised from the same repository but different branch, then the action works as expected. Only when there's a PR coming from a fork, it fails. Any way to go around this? Thanks |
Beta Was this translation helpful? Give feedback.
@IamShubhamGupto Yep, looks approximately right to me:
https://github.com/compressed-sensing/algorithms/blob/cbf887bd7d0c0bad45ae3e603098dd405b764e63/.github/workflows/preview.yml#L62C2-L65
Best way to test it will be to create a PR now and see if the preview works as expected.
I notice in your
gh-pages
branch there's a stale preview for a closed PR that wasn't cleaned up: https://github.com/compressed-sensing/algorithms/tree/gh-pages/pr-preview/pr-11 - I suspect this is from when you were trialling different preview methods and turned off my action before it h…