Skip to content

KAFKA-20463: Auto-deploy to asf-site on PR merge#849

Open
Owen-CH-Leung wants to merge 3 commits into
apache:markdownfrom
Owen-CH-Leung:ci/deploy-site-when-merging-pr
Open

KAFKA-20463: Auto-deploy to asf-site on PR merge#849
Owen-CH-Leung wants to merge 3 commits into
apache:markdownfrom
Owen-CH-Leung:ci/deploy-site-when-merging-pr

Conversation

@Owen-CH-Leung

Copy link
Copy Markdown

Previously, merging a PR only deployed to asf-staging because inputs.deploy-to-asf-site is 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.

Comment thread .github/workflows/build-and-deploy.yml Outdated
- 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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this workflow ?

  • We push to asf-staging automatically on PR merge
  • We add a separate scheduled/auto job that promotes asf-staging to asf-site that runs twice a week

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We add a separate scheduled/auto job that promotes asf-staging to asf-site that runs twice a week

sounds good :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Owen-CH-Leung Owen-CH-Leung Apr 28, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants