apify-docs icon indicating copy to clipboard operation
apify-docs copied to clipboard

Preview build of docs on PR

Open TC-MO opened this issue 10 months ago • 4 comments

We need a docs preview, the idea is to be able to clickthrough docs, while addinf new content & collaborating with people for whom setting up docs locally might be a point of friction.

In an ideal scenario what we are lookg for is to:

  • be able to click through whole Platform docs & Academy & API docs
  • be able to test that links works properly (at least the ones that send to different parts of the same repository)
  • preview should be no longer accessible after merge of PR

TC-MO avatar Mar 07 '25 23:03 TC-MO

I thought that the easiest way would be to create an AWS S3 bucket apify-docs-previews and then simply after docs are built you call aws s3 sync (https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html) to sync the docs build into s3://apify-docs-previews/pull-[pull-request-number].

IIRC, you must use --acl public-read to make it publically readable.

Then it will become visible https://s3.amazonaws.com/apify-docs-preview/pull-[pull-request-number]/index.html.

@seyhello - would it be then possible to configure ALB to route https://pull-[pull-request-number].preview.docs.apify.com/[path] to https://s3.amazonaws.com/apify-docs-preview/pull-[pull-request-number]/[path]? This would enable us to use absolute URLs in docs easily with no override.

mtrunkat avatar Apr 01 '25 13:04 mtrunkat

If it helps at all, i was able to pull this off with s3 and cloudfront 👀. I can also automate this I think relatively easily, but maybe you guys use some other things already in aws?

vladfrangu avatar Apr 01 '25 13:04 vladfrangu

@TC-MO small question! When you say preview, you mean only with the content from this repository, right? So if you change something strictly related to apify docs not if something is done for, say, crawlee

vladfrangu avatar May 14 '25 15:05 vladfrangu

Yup exactly, right now I'm concerned only with apify-docs to have the whole setup would be overkill (for now, subject to change in the future :D)

TC-MO avatar May 14 '25 16:05 TC-MO