diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1e828c5144..53157c815a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,12 +1,22 @@ name: Build documentation on: - pull_request: + push: paths: - python/** - docs/** - mkdocs.yml - .github/workflows/docs.yml + repository_dispatch: + types: + - release-docs + # Allow manual trigger for now + workflow_dispatch: + +env: + IS_RELEASE: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }} + BUILD_ARGS: ${{ (github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch') && 'install MATURIN_EXTRA_ARGS="--manylinux off"' || 'develop' }} + jobs: markdown-link-check: runs-on: ubuntu-latest @@ -26,6 +36,11 @@ jobs: src: docs/src/python build: + needs: + [ + lint, + markdown-link-check, + ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -50,15 +65,29 @@ jobs: pip install virtualenv virtualenv venv source venv/bin/activate - make develop - cd .. + make ${{ env.BUILD_ARGS }} - name: Install dependencies run: | source python/venv/bin/activate pip install -r docs/requirements.txt - - name: Build documentation + - name: Build run: | source python/venv/bin/activate - mkdocs build \ No newline at end of file + mkdocs build + + - name: Deploy + if: ${{ env.IS_RELEASE == 'true' }} + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: site + clean-exclude: | + python/ + .nojekyll + single-commit: false + git-config-name: "Github Action" + git-config-email: "deltars@users.noreply.github.com" + commit-message: "doc update for tag `${{ github.event.client_payload.tag || github.ref_name }}`" + + diff --git a/.github/workflows/python_release.yml b/.github/workflows/python_release.yml index 64a57ae7c5..5dffdd651c 100644 --- a/.github/workflows/python_release.yml +++ b/.github/workflows/python_release.yml @@ -131,38 +131,11 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # fetch full history for gh-pages branch checkout - - name: Install minimal stable with clippy and rustfmt - uses: actions-rs/toolchain@v1 + - name: Trigger the docs release event + uses: peter-evans/repository-dispatch@v2 with: - profile: default - toolchain: stable - override: true - - - name: Build and install deltalake - run: | - make install MATURIN_EXTRA_ARGS="--manylinux off" - - - name: Build Sphinx documentation - run: | - make build-documentation - mv docs/build ~/build - - echo "Configuring git..." - git config --global user.name 'Github Action' - git config --global user.email 'deltars@users.noreply.github.com' - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY - - echo "Commit to gh-pages branch..." - git reset --hard HEAD - git clean -d -fx . - git checkout gh-pages - cd .. - cp -avr ~/build/html/. ./python - PUSHED_TAG=${GITHUB_REF##*/} - git status - git add ./python - git commit -m "doc update for tag `${PUSHED_TAG}`" - git push origin gh-pages + event-type: release-docs + client-payload: > + { + "tag": "${{ github.ref_name }}" + } \ No newline at end of file diff --git a/docs/_build/links.yml b/docs/_build/links.yml index 6871001975..605cda2d55 100644 --- a/docs/_build/links.yml +++ b/docs/_build/links.yml @@ -1,4 +1,4 @@ python: - DeltaTable: PYTHON_API_URL#deltalake.table.DeltaTable + DeltaTable: PYTHON_API_URL/delta_table rust: DeltaTable: https://docs.rs/deltalake/latest/deltalake/table/struct.DeltaTable.html \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index cb773ff8bd..9ad8d6a4a2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -88,4 +88,4 @@ markdown_extensions: - footnotes extra: - python_api_url: https://delta-io.github.io/delta-rs/python/api_reference.html \ No newline at end of file + python_api_url: https://delta-io.github.io/delta-rs/api/ \ No newline at end of file