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
Allow docs pull requests to trigger staging deploys #120
Comments
Shouldn't we have separate deployments per PR ? Otherwise, the staging site always corresponds to the latest updated PR, which may not be the one you are interested in currently. |
Yes, eventually I would love to have it work that way. Just requires work. |
what is the hosting being used currently ? |
Github pages. https://github.com/doctrine/doctrine-website-build-staging This would have to change for at least staging or we have multiple deploys stored in the repo. Each one in a sub folder. |
I want to do it all with gh pages and without any custom hosting or vms for hooks. But I realize we are fairly limited in what we can do by having that restriction. The reason is we don't want to have to maintain any servers that require updates, access control, etc. Right now we have a vm that receives web hooks, triggers the build and pushes to the gh pages build repository. |
so, how do you plan to trigger website build for updates in each projects ? |
@stof My current thought is to enhance the webhook script https://github.com/doctrine/doctrine-website/blob/master/hooks/deploy.php to store a JSON document for the last webhook received. I think it would just store the project and the sha. This script could be refactored and cleaned up in general too. It should just be using some classes in Example JSON:
Then we enhance https://github.com/doctrine/doctrine-website/blob/master/app/src/Doctrine/Website/Docs/BuildDocs.php#L77 to allow you to sync git for a specific project & sha. Then we can use that enhancement in https://github.com/doctrine/doctrine-website/blob/master/app/src/Doctrine/Website/Deployer.php#L80 to get the JSON document that we write from the github webhook and then dynamically build the commands to build the docs for that project and sha, rebuild the website and publish:
Just for more context. On the server that receives the webhooks from github we have the following crons:
Every minute the deploy command is ran and it looks for the file written by the webhook script and checks if a deploy is required. Even though it only supports deploying the last thing that was pushed, I think the frequency will be low enough initially for it to work fine. We could enhance staging later to have directories for each branch with some kind of cleanup process. Then you can go to https://staging.doctrine-project.org/branch-name and view your changes. |
Right now a docs PR won't work with staging deploys.
The text was updated successfully, but these errors were encountered: