Add workflow to automatically generate and commit site HTML#697
Conversation
|
I need a maintainer to approve the workflow runs so I can test my changes. |
|
Thank you to whoever approved the previous workflows. I need another approval. Could I perhaps be added to some workflow whitelist so maintainers don't have to manually approve my workflows every time? |
|
Looks like everything is working. New This is just test behavior. Before merging, I will remove it so that |
|
so PR only need to modify md files, once PR is merged, a post-merge job will regenerate html and push? how do we handle concurrency? like 2 PRs merged almost at the same time? |
Correct.
There should be no problem.
To be a bit cleaner and avoid the spurious workflow failure in this scenario, I've added a concurrency group so that the workflow for commit C1 would be canceled immediately once the workflow for commit C2 starts. |
@cloud-fan - Checking in again about this. Not absolutely required, obviously, but it would make it easier for me to contribute here. I understand there is a repo setting to require workflow approval only for first-time contributors to a repo. You can also add me specifically as a read-only repo collaborator. |
|
to be clear, the post-merge job will generate HTML for the current codebase, so even if something goes wrong, a later post-merge job will make md files and HTML fully in sync again? BTW I don't think Apache allow us to add a workflow approver, so it has to be approved every single time... |
Correct. Every commit to spark-website/.github/workflows/html-push.yml Lines 13 to 15 in 6eab236 Whenever a new commit is pushed to |
Can we use a more internal marker that no one will accidentally use in their own PR title? |
|
I kept the spark-website/.github/workflows/html-push.yml Lines 15 to 19 in bf80b5e That way, even if contributors accidentally use |
|
LGTM if CI is green |
|
Just wanted to double check one thing with you before you merge:
Is my analysis about In any case, I'll be watching closely here after you merge to make sure everything builds and deploys correctly. |
|
yea there is no staging site AFAIK. |
|
Looks like something went wrong! Perhaps @cloud-fan - Better revert for now and I'll look into this. |
|
I think the problem is I will open a new PR (after we first get the site back up) with all the same changes here, minus the deletion of the |
As proposed here, I believe it would be best to overhaul the workflow for this project by splitting the source into a
masterbranch, and havingasf-sitebe just for the generated HTML. We could even have per-branch staging sites generated and published automatically for us by ASF.However, this PR takes a more conservative approach as suggested by @cloud-fan and reworks the GitHub Actions workflows as follows:
html-build.yml: Added a new workflow that runs on PRs and simply generates the docs. This confirms the Jekyll build is not obviously broken.html-push.yml: Added a new workflow that runs on new commits toasf-site. It generates the docs and pushes the generated HTML automatically as a new commit toasf-site.doc_gen.yml: Deleted since it is subsumed by the new workflows.This PR also removes the
content/symlink tosite/, which doesn't appear to be needed. ASF understands Jekyll configs and looks here to know where to serve the site from:spark-website/_config.yml
Line 6 in fd110d9
TODO:
pushworkflow.