Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 166
Add a workflow that builds the docs and deploys them at staged or production#104
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
aea783e91d97e6289f36ee0a6910617ead0832cc6d8f46ef9822153ed5e32a22a65b5d8b92e71e0692faFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| tags-ignore: | ||
| - "**-rc**" | ||
| name: Deploy DataFusion Python site | ||
| jobs: | ||
| build-docs: | ||
| name: Build docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Set target branch | ||
| id: target-branch | ||
| run: | | ||
| set -x | ||
| if test '${{ github.ref }}' = 'refs/heads/master'; then | ||
| echo "value=asf-staging" >> $GITHUB_OUTPUT | ||
| elif test '${{ github.ref_type }}' = 'tag'; then | ||
| echo "value=asf-site" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "Unsupported input: ${{ github.ref }} / ${{ github.ref_type }}" | ||
| exit 1 | ||
| fi | ||
| - name: Checkout docs sources | ||
| uses: actions/checkout@v3 | ||
| - name: Checkout docs target branch | ||
| uses: actions/checkout@v3 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ steps.target-branch.outputs.value }} | ||
| path: docs-target | ||
Comment on lines
+29
to
+34
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that we need to prepare How about using diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml
index 806202a..bfafafa 100644
--- a/.github/workflows/docs.yaml+++ b/.github/workflows/docs.yaml@@ -26,12 +26,6 @@ jobs:
fi
- name: Checkout docs sources
uses: actions/checkout@v3
- - name: Checkout docs target branch- uses: actions/checkout@v3- with:- fetch-depth: 0- ref: ${{ steps.target-branch.outputs.value }}- path: docs-target
- name: Setup Python
uses: actions/setup-python@v4
with:
@@ -61,7 +55,12 @@ jobs:
- name: Copy & push the generated HTML
run: |
set -x
+ git worktree add docs-target
cd docs-target
+ if ! git checkout ${{ steps.target-branch.outputs.value }}; then+ git checkout --orphan ${{ steps.target-branch.outputs.value }}+ git rm -rf .+ fi
# delete anything but: 1) '.'; 2) '..'; 3) .git/
find ./ | grep -vE "^./$|^../$|^./.git" | xargs rm -rf
cp ../.asf.yaml .MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO this is more complex/confusing than the current solution. MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A task before merging this PR is to create Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install dependencies | ||
| run: | | ||
| set -x | ||
| python3 -m venv venv | ||
| source venv/bin/activate | ||
| pip install -r requirements-310.txt | ||
| pip install -r docs/requirements.txt | ||
| - name: Build Datafusion | ||
| run: | | ||
| set -x | ||
| source venv/bin/activate | ||
| maturin develop | ||
| - name: Build docs | ||
| run: | | ||
| set -x | ||
| source venv/bin/activate | ||
| cd docs | ||
| make html | ||
| - name: Copy & push the generated HTML | ||
| run: | | ||
| set -x | ||
| cd docs-target | ||
| # delete anything but: 1) '.'; 2) '..'; 3) .git/ | ||
| find ./ | grep -vE "^./$|^../$|^./.git" | xargs rm -rf | ||
| cp ../.asf.yaml . | ||
| cp -r ../docs/build/html/* . | ||
| git status --porcelain | ||
| if [ "$(git status --porcelain)" != "" ]; then | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git add --all | ||
| git commit -m 'Publish built docs triggered by ${{ github.sha }}' | ||
| git push || git push --force | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.