Preview build of docs on PR
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
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.
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?
@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
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)