Skip to content

Workflow test doc build #9695

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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Workflow test doc build #9695

wants to merge 9 commits into from

Conversation

CaselIT
Copy link
Member

@CaselIT CaselIT commented Apr 23, 2023

Try building the docs on github.

The last run has sphinx v6 installed manually just for test.

It's missing the main site though, so still wip

test runs are at https://github.com/sqlalchemy/sqlalchemy/actions/workflows/build-docs.yaml

CaselIT added 2 commits April 23, 2023 21:41
Change-Id: I3f5ad6f3832ea56aba72c62f6bd2092288dcb5c9
Change-Id: Ib2e2c1e065a58575a10571a5f59fe3a51c88eed7
@CaselIT
Copy link
Member Author

CaselIT commented Apr 23, 2023

cross posting from sqlalchemyorg/zzzeeksphinx#20 (comment)

ok, this is a script that can be run in cron to download the last artifact run from github and copied to the public folder.

#!/bin/bash -e
branch=workflow_test_doc_build  # change with wanted branch. main or rel_1_4
dest_folder=/public/docs  # change with public docs folder
current_run_file=/home/sa_current_run  # keep track of the last deployed version

last_run=$(gh run list --workflow 'Build docs' --branch $branch --limit 1 --status success --json databaseId | jq -r .[0].databaseId | tr -d '\r')
echo "Last run is '$last_run'"

touch $current_run_file
current_run=$(cat $current_run_file)

if [ "$current_run" == "$last_run" ]
then
    echo "Last build already deployed. Nothing to do"
    exit 0
else
    echo "Downloading updated file"
    gh run download $last_run --name docs-archive --dir /tmp
    cd /tmp
    tar zxf docs.tgz
    mv doc/build/output/html/* $dest_folder
    echo $last_run > $current_run_file
    echo "Done. Updated $dest_folder with run $last_run"
fi

requires gh (the github cli) to be installed and configured (it requires a login) and jq.

in what repo would the be placed?

# branches used to test the workflow
- "workflow_test_*"
paths-ignore:
- "examples/**"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to remove this, since examples are in the docs: https://docs.sqlalchemy.org/en/20/orm/examples.html

run: |
python -m pip install --upgrade pip
pip install --requirement doc/build/requirements.txt
pip install -U sphinx>6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line

zzzeek and others added 7 commits April 24, 2023 13:20
Change-Id: Ide8e15bacb823b5f7a9aae21cd0b871294556b7d
Change-Id: Ida158e1528cc3f2b81611aef50d2c87a85b9a5a3
Change-Id: I134879f35dbc44548342634fa4f83a80d3ed0df5
Change-Id: I8988a644f63133dcf8877f0c7f79ce35585a124f
Change-Id: Ib9c9104d945a916df2fd2dcab523d23785693a42
Change-Id: I59a2d2699dd19568be71cba5a4aed4e155b5a2e1
Change-Id: I32d8e2019c94b067d0298c5e303e5fd678946471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants