Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add release action #1801

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ on:
- 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
Expand All @@ -26,6 +36,11 @@ jobs:
src: docs/src/python

build:
needs:
[
lint,
markdown-link-check,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -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
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 }}`"


41 changes: 7 additions & 34 deletions .github/workflows/python_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
}
2 changes: 1 addition & 1 deletion docs/_build/links.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ markdown_extensions:
- footnotes

extra:
python_api_url: https://delta-io.github.io/delta-rs/python/api_reference.html
python_api_url: https://delta-io.github.io/delta-rs/api/
Loading