Local development #15280
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Local development | |
# **What it does**: Basic smoke test to ensure local dev server starts and serves content | |
# **Why we have it**: Catch catastrophic "npm start is completely broken" scenarios | |
# **Who does it impact**: Engineers, Contributors. | |
on: | |
merge_group: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
local-dev: | |
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: ./.github/actions/node-npm-setup | |
- uses: ./.github/actions/get-docs-early-access | |
if: ${{ github.repository == 'github/docs-internal' }} | |
with: | |
token: ${{ secrets.DOCS_BOT_PAT_BASE }} | |
- name: Disable Next.js telemetry | |
run: npx next telemetry disable | |
- name: Start server and basic smoke test | |
run: | | |
# Start server in background | |
npm start > /tmp/stdout.log 2> /tmp/stderr.log & | |
SERVER_PID=$! | |
# Wait for server to be ready and test homepage | |
if curl --fail --retry-connrefused --retry 10 --retry-delay 2 http://localhost:4000/; then | |
echo "✅ Local dev server started successfully and serves homepage" | |
kill $SERVER_PID 2>/dev/null || true | |
else | |
echo "❌ Local dev server failed to start or serve content" | |
echo "____STDOUT____" | |
cat /tmp/stdout.log | |
echo "____STDERR____" | |
cat /tmp/stderr.log | |
kill $SERVER_PID 2>/dev/null || true | |
exit 1 | |
fi |