docs(blog): new blog flink 1.1 optimization #2451
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: asf-site CI | |
| on: | |
| push: | |
| branches: [ asf-site ] | |
| pull_request: | |
| branches: [ asf-site ] | |
| # Cancel in-progress runs when a new push is made to the same PR or branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| hudi-asf-site-ci: | |
| name: "Apache Hudi asf-site CI" | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCS_ROOT: "./website" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # For PR: need enough commits for diff (100 should cover most PRs) | |
| # For push: only need latest commit | |
| fetch-depth: ${{ github.event_name == 'pull_request' && 100 || 1 }} | |
| # Skip tags - this saves significant time | |
| fetch-tags: false | |
| - name: Check for files in content/ | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "Changed files:" | |
| git fetch origin ${{ github.base_ref }} | |
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} HEAD) | |
| echo "$CHANGED_FILES" | |
| if echo "$CHANGED_FILES" | grep -q '^content/'; then | |
| echo "❌ PR should not change files under content/; change the files under website/ instead." | |
| exit 1 | |
| else | |
| echo "✅ No files under content/ directory." | |
| fi | |
| - name: Check for absolute /docs/ paths in markdown links | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "🔍 Checking for absolute /docs/ paths in markdown links..." | |
| # Get the base branch | |
| git fetch origin ${{ github.base_ref }} | |
| # Get list of changed files in the PR | |
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }} HEAD) | |
| # Filter for .md and .mdx files in website/docs/ | |
| DOCS_FILES=$(echo "$CHANGED_FILES" | grep -E '^website/docs/.*\.(md|mdx)$' || true) | |
| if [ -z "$DOCS_FILES" ]; then | |
| echo "✅ No markdown files changed in website/docs/" | |
| exit 0 | |
| fi | |
| echo "📝 Checking the following files:" | |
| echo "$DOCS_FILES" | |
| echo "" | |
| # Variable to track if we found any issues | |
| FOUND_ISSUES=false | |
| ISSUE_FILES="" | |
| # Check each file for markdown links starting with /docs/ | |
| while IFS= read -r file; do | |
| if [ -f "$file" ]; then | |
| # Look for markdown links with /docs/ paths | |
| # Pattern: [text](/docs/...) | |
| if grep -Hn '\[.*\](\s*/docs/[^)]*)' "$file" > /dev/null 2>&1; then | |
| FOUND_ISSUES=true | |
| ISSUE_FILES="${ISSUE_FILES}${file}\n" | |
| echo "❌ Found absolute /docs/ paths in: $file" | |
| echo " Lines with issues:" | |
| grep -Hn '\[.*\](\s*/docs/[^)]*)' "$file" | while IFS= read -r line; do | |
| echo " $line" | |
| done | |
| echo "" | |
| fi | |
| fi | |
| done <<< "$DOCS_FILES" | |
| if [ "$FOUND_ISSUES" = true ]; then | |
| echo "" | |
| echo "=========================================" | |
| echo "❌ ERROR: Found absolute /docs/ paths in markdown links!" | |
| echo "=========================================" | |
| echo "" | |
| echo "📋 Files with issues:" | |
| echo -e "$ISSUE_FILES" | |
| echo "💡 SUGGESTION: Use relative paths instead of absolute paths." | |
| echo "" | |
| echo "Examples:" | |
| echo " ❌ Bad: [link text](/docs/guide/overview)" | |
| echo " ✅ Good: [link text](overview) or [link text](../guide/overview)" | |
| echo "" | |
| echo "Relative paths ensure links work correctly across different versions" | |
| echo "and environments. Please update the links to use relative paths." | |
| exit 1 | |
| else | |
| echo "" | |
| echo "✅ All markdown links use appropriate paths (no absolute /docs/ paths found)" | |
| fi | |
| - name: Prepare branch | |
| run: | | |
| git config --global user.name "CI BOT" | |
| git config --global user.email "[email protected]" | |
| git checkout -b ci-build | |
| git remote add hudi https://${{ secrets.GITHUB_TOKEN }}@github.com/apache/hudi.git | |
| git pull --rebase hudi asf-site | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Build website | |
| run: | | |
| pushd ${{ env.DOCS_ROOT }} | |
| npm install | |
| npm run build | |
| popd | |
| - name: Publish website | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: | | |
| echo "pushing build result ..." | |
| rm -rf content | |
| cp -R ${{ env.DOCS_ROOT }}/build content | |
| git add -A | |
| git commit -am "GitHub Actions build asf-site" | |
| git push hudi ci-build:asf-site |