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

ci(docs): Added broken link detection to docs deploy workflow #305

Merged
merged 2 commits into from
May 30, 2024

Conversation

tylwright
Copy link
Contributor

This should add a broken link detection step to the docs deployment workflow. In the background, it's really using Muffet and doing this:

muffet -v --max-connections=3 --timeout=20 --buffer-size=8192 --color=always --exclude="(/_nuxt/|discord.com)" https://garethgeorge.github.io/backrest/

Why add this?
Doc sites are always important to the end user and the devs. Broken links help no one and can happen out-of-the-blue. Checking all links during the build would be beneficial as we could fix broken links before users notice them.

Notes

  • Later on down the road, we may want to have this check be a separate GH Action that runs nightly.
  • In this workflow, we're deploying the pages first and then scanning the public endpoint for broken links. This was done so that the latest docs still get published even if there is a broken link. We can re-order this later on, if wanted. It also has the ability to scan the local files instead so it can detect any errors before publishing the pages.

@garethgeorge
Copy link
Owner

Hey! I think this is a great idea, thanks for contributing it. It looks like the workflow runs on the live URL right now which won't actually end up validating the most recent changes (as they're being built). Is it possible to point it at a local filesystem path e.g. the build directory?

@tylwright
Copy link
Contributor Author

I can totally do that! I'll get that change checked in later this afternoon and append it to this PR. Thanks!

@tylwright
Copy link
Contributor Author

I've updated it to check the local docs. Note: The URL arg is required even when providing the local dir's path.

@garethgeorge
Copy link
Owner

LGTM, thanks for setting this up!

@garethgeorge garethgeorge merged commit 43fb254 into garethgeorge:main May 30, 2024
3 checks passed
@tylwright tylwright deleted the broken-link-detect branch May 30, 2024 15:05
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