Skip to content

docs: update python integrations documentation #7710

docs: update python integrations documentation

docs: update python integrations documentation #7710

name: Check links from the UI
on:
workflow_dispatch:
pull_request:
branches:
- master
schedule:
- cron: '0 1 * * *' # once a day at 1 am
jobs:
preview:
name: Check links from UI
runs-on: ubuntu-22.04
steps:
- name: Check-out
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
working-directory: docs
run: pip install -r requirements-docs.txt
- name: Checkout the documentation repository
uses: actions/checkout@v4
with:
repository: treeverse/docs-lakeFS
fetch-depth: 1
token: ${{ secrets.PERSONAL_TOKEN }}
path: docs/docs-repo
- name: Configure Git
working-directory: docs/docs-repo
run: |
git config --global user.name "treeverser"
git config --global user.email "[email protected]"
- name: Build latest
working-directory: docs/docs-repo
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
run: |
mike deploy --config-file ../mkdocs.yml --branch main dev --update-aliases latest
- name: Get links to check
id: get-links
run: |
escaped_pwd=$(pwd | sed 's/[\/&]/\\&/g')
echo $pwd
echo $escaped_pwd
ls -l
find webui/src -type f ! -name "*.js" -exec grep -Eo 'href="([^"]*)"' {} \; | \
cut -d'"' -f2 | \
grep -v -e "^/" -e "^#" | \
sed "s/https:\/\/docs.lakefs.io/file:\/\/$escaped_pwd\/docs\/docs-repo/" > /tmp/links_to_check.txt
- name: Check links
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: /tmp/links_to_check.txt
fail: false
jobSummary: false
format: markdown
output: /tmp/lychee/results.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Check Lychee output
run: |
if grep "Errors per input" /tmp/lychee/results.md; then
echo "## 🙀 Outbound links found in the lakeFS UI that are broken" > $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
while IFS= read -r line; do
if [[ $line =~ .*docs/_site(.*)\].* ]]; then
search_phrase="${BASH_REMATCH[1]}"
matching_files=$(grep -lr "$search_phrase" "webui/src")
echo "* 🚨 Broken reference to \`$search_phrase\` found in \`$matching_files\`" >> $GITHUB_STEP_SUMMARY
fi
done < /tmp/lychee/results.md
echo "" >> $GITHUB_STEP_SUMMARY
sed -e '/## Errors per input/,$d' /tmp/lychee/results.md >> $GITHUB_STEP_SUMMARY
cat $GITHUB_STEP_SUMMARY
exit 1
else
echo "## ✅ All outbound links found in the lakeFS UI are working" > $GITHUB_STEP_SUMMARY
exit 0
fi