Skip to content
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

[DOCS-1262] Add GH action for per-page preview links #1091

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mdlinville
Copy link
Contributor

@mdlinville mdlinville commented Feb 10, 2025

DOCS-1262 Add GH action for per-page preview links to aid review of docs PRs

  • Run on PR creation and update
  • Transform content/**/*.md to the corresponding Cloudflare URL, including interpreting _index.md
  • Create or update the same comment in the PR

Docs: https://github.com/marketplace/actions/changed-files
Inspiration: https://github.com/cockroachdb/docs/blob/main/.github/workflows/changed_files.yml

@mdlinville mdlinville requested a review from a team as a code owner February 10, 2025 19:33
Copy link
Contributor

github-actions bot commented Feb 10, 2025

HTML previews:

  • No preview: .github/workflows/changed_files.yml

Preview links work **only** after the `Cloudflare Pages` build check succeeds. Links are generated only for new and modified .md files under content/.

Feedback about HTML previews

Copy link

cloudflare-workers-and-pages bot commented Feb 10, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3787b25
Status: ✅  Deploy successful!
Preview URL: https://4d312017.docodile.pages.dev
Branch Preview URL: https://docs-1262.docodile.pages.dev

View logs

@mdlinville mdlinville force-pushed the DOCS-1262 branch 2 times, most recently from 2b35400 to 804c577 Compare February 10, 2025 19:57
@wandb wandb deleted a comment from github-actions bot Feb 10, 2025
@wandb wandb deleted a comment from github-actions bot Feb 10, 2025
@mdlinville mdlinville force-pushed the DOCS-1262 branch 13 times, most recently from d1dc1ea to b1c94ea Compare February 10, 2025 23:53
@mdlinville mdlinville force-pushed the DOCS-1262 branch 9 times, most recently from ef782dc to 8292892 Compare February 12, 2025 20:20
@mdlinville mdlinville force-pushed the DOCS-1262 branch 14 times, most recently from e77d5a5 to 93b0bef Compare February 14, 2025 19:49
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
<h3>HTML previews:</h3><ul>${{ env.body }}</ul><p>Preview links work **only** after the `Cloudflare Pages` build check succeeds. Links are generated only for new and modified <code>.md</code> files under <code>content/</code>.</p><p><a href="https://github.com/wandb/docs/issues/new?title=Feedback+about+HTML+preview+comments&assignees=mdlinville&body=Link+to+PR+and+describe+the+issue">Feedback about HTML previews</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to be concise with the comment, we can move:

"Links are generated only for new and modified .md files under content/."

to a CONTRIBUTING.md file.

output+="<li>$file</li>"
}

for file in ${files[@]}; do
Copy link
Contributor

Choose a reason for hiding this comment

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

The format of the markdown is a little confusing.

Can separate the non generated vs generated links into separate sections or add "Generated preview" to the second bullet point in body?

i.e. From this:

HTML previews:

  • No preview: filename
  • filename (generated preview)

To something like:

HTML previews:

  • No preview generated for: filename
  • Generated preview: filename, filename, filename

or perhaps even

HTML previews:

  • No preview generated for:
    • filename
    • filename
  • Generated preview:
    • filename
    • filename

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.

2 participants