diff --git a/.github/workflows/link-check-cron-crawler.yml b/.github/workflows/link-check-cron-crawler.yml new file mode 100644 index 0000000000000..c3b5053b46333 --- /dev/null +++ b/.github/workflows/link-check-cron-crawler.yml @@ -0,0 +1,17 @@ +name: link-check-cron-crawler + +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +permissions: + contents: read + +jobs: + cron-crawler: + runs-on: ubuntu-latest + steps: + - name: Run Crawler Link Checker + run: | + npx -y linkinator https://doris.apache.org --recurse --check-images --skip "^(?!https?://(www\.)?doris\.apache\.org)" diff --git a/.github/workflows/link-check-pr-crawler.yml b/.github/workflows/link-check-pr-crawler.yml new file mode 100644 index 0000000000000..3bbe63e4a62bf --- /dev/null +++ b/.github/workflows/link-check-pr-crawler.yml @@ -0,0 +1,47 @@ +name: link-check-pr-crawler + +on: + pull_request: + paths: + - 'docs/**' + - 'versioned_docs/**' + - 'i18n/**' + - 'src/**' + - 'static/**' + - 'docusaurus.config.js' + - 'sidebars.ts' + - 'versioned_sidebars/**' + - 'versions.json' + +concurrency: + group: link-check-pr-crawler-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + pr-crawler: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build website + run: yarn build + + - name: Serve build folder and scan for 404s/broken images + run: | + npx -y serve build -l 3000 & + # Wait for server to start + sleep 5 + npx -y linkinator http://localhost:3000 --recurse --check-images --skip "^(?!http://localhost:3000)"