From d2f487e0edd25098e4d9f83c034bd93a9a0a1816 Mon Sep 17 00:00:00 2001 From: Nikolay Ulmasov Date: Sat, 4 Nov 2023 16:33:41 +0000 Subject: [PATCH 1/2] add release actions for docs Signed-off-by: Nikolay Ulmasov --- .github/workflows/docs.yml | 39 ++++++++++++++++++++++---- .github/workflows/python_release.yml | 41 +++++----------------------- docs/_build/links.yml | 2 +- mkdocs.yml | 2 +- 4 files changed, 43 insertions(+), 41 deletions(-) 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 6793d129a0..9b824c0272 100644 --- a/.github/workflows/python_release.yml +++ b/.github/workflows/python_release.yml @@ -127,38 +127,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 From ac340616b1bdad9ca8b0e8a7b60c22dcc501f94a Mon Sep 17 00:00:00 2001 From: Nikolay Ulmasov Date: Sat, 4 Nov 2023 16:41:33 +0000 Subject: [PATCH 2/2] change from push to pull_request Signed-off-by: Nikolay Ulmasov --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 53157c815a..09740c4c9d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,7 +1,7 @@ name: Build documentation on: - push: + pull_request: paths: - python/** - docs/**