Skip to content

Commit b6c09c3

Browse files
authored
ci(workflows): drop link check job
1 parent 202d03e commit b6c09c3

1 file changed

Lines changed: 11 additions & 60 deletions

File tree

.github/workflows/sphinxbuild.yml

Lines changed: 11 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,9 @@ jobs:
266266
# This job is responsible for:
267267
# 1. Determining deployment target folder names (branch_name/version_name)
268268
# 2. Organizing build artifacts into a clean structure
269-
# 3. Validating the documentation (link checking)
270-
# 4. Uploading a minimal staging artifact for the deploy job
269+
# 3. Uploading a minimal staging artifact for downstream jobs
271270
#
272-
# IMPORTANT: This job does NOT modify gh-pages. It only prepares and validates
271+
# IMPORTANT: This job does NOT modify gh-pages. It only prepares
273272
# the artifacts that will be deployed. The actual deployment happens in the
274273
# deploy job.
275274
# ============================================================================
@@ -435,7 +434,7 @@ jobs:
435434
# ========================================================================
436435
# UPLOAD STAGING ARTIFACTS
437436
# ========================================================================
438-
# Upload the staging folder for use in both the deploy and link-check jobs.
437+
# Upload the staging folder for use in downstream jobs.
439438
# ========================================================================
440439
- name: Upload staged artifacts
441440
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -444,54 +443,6 @@ jobs:
444443
path: stage/
445444
retention-days: 1
446445

447-
# ============================================================================
448-
# LINK CHECK
449-
# ============================================================================
450-
# Runs in parallel with deploy. Downloads the staged artifacts, strips
451-
# canonical links, then runs lychee against the new content only.
452-
# ============================================================================
453-
link-check:
454-
name: Check for broken links
455-
needs: stage-and-check
456-
runs-on: ubuntu-latest
457-
458-
steps:
459-
- name: Download staged artifacts
460-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
461-
with:
462-
name: staged-docs
463-
path: stage/
464-
465-
- name: Strip canonical links from validation HTML
466-
run: |
467-
find "stage/${{ needs.stage-and-check.outputs.branch_name }}" -name '*.html' -print0 | while IFS= read -r -d '' f; do
468-
perl -0pi -e 's{^\s*<link rel="canonical" href="https://docs\.nextcloud\.com/server/[^"]*" />\n}{}m' "$f"
469-
done
470-
ls -la stage/*
471-
472-
# We need to exclude certain links from the check:
473-
# - go.php: This is a special redirect page
474-
# - mailto: links: These are not valid URLs and will always fail
475-
# - 404.html: This is not necessary
476-
# - latest/stable/xx links from the version selector
477-
- name: Check for broken links with lychee
478-
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
479-
with:
480-
fail: true
481-
token: ${{ secrets.GITHUB_TOKEN }}
482-
jobSummary: true
483-
args: |
484-
--root-dir "$(pwd)/stage"
485-
--offline --no-progress
486-
--remap "https://docs.nextcloud.com/server/latest/ file://$(pwd)/stage/${{ needs.stage-and-check.outputs.branch_name }}/"
487-
--remap "https://docs.nextcloud.com/server/ file://$(pwd)/stage/"
488-
--exclude 'go\.php' --exclude 'mailto:' --exclude-path '.*/404\.html' --exclude-path '.*/_static/.*'
489-
--exclude "/user_manual/" --include "/user_manual/en/"
490-
--exclude '^file://.*/stage/(latest|stable|[0-9]+)/(developer_manual|admin_manual|user_manual)/?$'
491-
'stage/${{ needs.stage-and-check.outputs.branch_name }}/user_manual/en/**/*.html'
492-
'stage/${{ needs.stage-and-check.outputs.branch_name }}/admin_manual/**/*.html'
493-
'stage/${{ needs.stage-and-check.outputs.branch_name }}/developer_manual/**/*.html'
494-
495446
# ============================================================================
496447
# DEPLOY
497448
# ============================================================================
@@ -660,7 +611,7 @@ jobs:
660611
# ============================================================================
661612
# NETLIFY PREVIEW
662613
# ============================================================================
663-
# Runs only on pull requests, in parallel with link-check.
614+
# Runs only on pull requests.
664615
# Downloads the staged-docs artifact (already produced by stage-and-check)
665616
# and deploys a preview to Netlify under a stable per-PR alias.
666617
#
@@ -846,7 +797,7 @@ jobs:
846797
}
847798
848799
summary:
849-
needs: [stage-and-check, link-check, deploy, netlify-preview]
800+
needs: [stage-and-check, deploy, netlify-preview]
850801
runs-on: ubuntu-latest-low
851802
if: always()
852803

@@ -860,13 +811,13 @@ jobs:
860811
run: |
861812
if ${{ github.event_name == 'pull_request' }}
862813
then
863-
echo "This workflow ran for a pull request. We need stage-and-check and link-check to succeed, deploy must be skipped, and netlify-preview must succeed or fail (non-fatal on forks)"
864-
if ${{ needs.stage-and-check.result != 'success' || needs.link-check.result != 'success' || needs.deploy.result != 'skipped' || (needs.netlify-preview.result != 'success' && needs.netlify-preview.result != 'failure') }}; then exit 1; fi
814+
echo "This workflow ran for a pull request. We need stage-and-check to succeed, deploy must be skipped, and netlify-preview must succeed or fail (non-fatal on forks)"
815+
if ${{ needs.stage-and-check.result != 'success' || needs.deploy.result != 'skipped' || (needs.netlify-preview.result != 'success' && needs.netlify-preview.result != 'failure') }}; then exit 1; fi
865816
elif ${{ github.event_name == 'push' }}
866817
then
867-
echo "This workflow ran for a push. We need stage-and-check and link-check to succeed; deploy and netlify-preview must be skipped"
868-
if ${{ needs.stage-and-check.result != 'success' || needs.link-check.result != 'success' || needs.deploy.result != 'skipped' || needs.netlify-preview.result != 'skipped' }}; then exit 1; fi
818+
echo "This workflow ran for a push. We need stage-and-check to succeed; deploy and netlify-preview must be skipped"
819+
if ${{ needs.stage-and-check.result != 'success' || needs.deploy.result != 'skipped' || needs.netlify-preview.result != 'skipped' }}; then exit 1; fi
869820
else
870-
echo "This workflow ran on schedule or workflow_dispatch. We need stage-and-check, link-check, and deploy to succeed; netlify-preview must be skipped"
871-
if ${{ needs.stage-and-check.result != 'success' || needs.link-check.result != 'success' || needs.deploy.result != 'success' || needs.netlify-preview.result != 'skipped' }}; then exit 1; fi
821+
echo "This workflow ran on schedule or workflow_dispatch. We need stage-and-check and deploy to succeed; netlify-preview must be skipped"
822+
if ${{ needs.stage-and-check.result != 'success' || needs.deploy.result != 'success' || needs.netlify-preview.result != 'skipped' }}; then exit 1; fi
872823
fi

0 commit comments

Comments
 (0)