Skip to content

check for 404s and 500s on previews #601

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

Merged
merged 5 commits into from
Sep 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ jobs:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
CODER_DOCS_MAIN_BRANCH: ${{ github.event.pull_request.head.sha }}

# This ensures the docs site is built properly
# as it will sometimes throw a 404 or 500
# error if Markdown/parsing errors are present
- name: Install node_modules
run: yarn install
- name: Check docs
run: yarn ts-node ./product/coder.com/site/scripts/checkDocs.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO it's a little clearer to use yarn run ts-node because people less familiar with Node might not be familiar with this behavior.

I'd also suggest putting this at the end of the build (after comment credentials) so that people can see the link to the preview. Otherwise, people won't be able to easily inspect the deployment (needed if you want to open the Vercel console and watch the function logs while you bring up the docs site)

env:
BASE_URL: ${{ steps.preview.outputs.url }}

- name: Update Deployment
# If we don't specify always, it won't run this check if failed.
# This means the deployment would be stuck pending.
Expand Down