KAFKA-20463: Auto-deploy to asf-site on PR merge#849
Conversation
| - name: Configure | ||
| id: configure | ||
| run: echo "ref=${{ inputs.deploy-to-asf-site && 'asf-site' || 'asf-staging' }}" >> "$GITHUB_OUTPUT" | ||
| run: echo "ref=${{ (github.event_name == 'push' || inputs.deploy-to-asf-site) && 'asf-site' || 'asf-staging' }}" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
I'm not sure if this is safe for us, as it could expose errors directly to our readers. Also, it essentially renders asf-staging useless, meaning we won't have the chance to preview or debug the website there beforehand
ping @mimaison WDYT?
There was a problem hiding this comment.
Yeah actually it seems this is a "feature" as it's described in https://github.com/apache/kafka-site#updating-the-website.
However I find the process a bit confusing, and I wasn't quite aware of it. I guess I'm not the only one as I've noticed the website being out of date a few times recently.
There was a problem hiding this comment.
How about this workflow ?
- We push to
asf-stagingautomatically on PR merge - We add a separate scheduled/auto job that promotes
asf-stagingtoasf-sitethat runs twice a week
There was a problem hiding this comment.
We add a separate scheduled/auto job that promotes asf-staging to asf-site that runs twice a week
sounds good :)
There was a problem hiding this comment.
Added a new CI scheduled job that promotes asf-staging to asf-site that runs every Monday & Thursday 02:00 UTC. Can you review agian ?
There was a problem hiding this comment.
I think the goal of targeting staging is to allow us to review the changes "live". If we could have a way to deploy the web-page on a PR, we would still have the safeguard in place? Not sure if this would be (easily) possible.
There was a problem hiding this comment.
Not sure if this would be (easily) possible.
Another simple approach is a post-commit check. After deploying to the staging site, the CI can leave a comment on the PR to remind the author to double-check the results. We can even include a note like: 'This will go live in 24 hours (or on the next schedule). Please file a follow-up PR if you spot any issues on staging.
There was a problem hiding this comment.
May be this be an option https://github.com/marketplace/actions/build-deploy-to-github-pages-and-deploy-pr-preview ?
On every commit we get a preview on GH Pages.
There was a problem hiding this comment.
I like @chia7712 idea. I have added a new step to the deploy job that posts a comment on the merged PR once staging is updated. It only fires on push-triggered runs (not manual dispatches) and silently skips if there's no associated PR. The comment links to the staging site and notes the Mon/Thu promotion schedule.
Previously, merging a PR only deployed to asf-staging because
inputs.deploy-to-asf-siteis null for push events. The live site required a manual workflow_dispatch with the checkbox enabled.Now push events deploy directly to asf-site. Manual runs without the checkbox still target asf-staging for testing.