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

First draft for readthedoc integration #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/conda-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ on:
anaconda_token:
description: 'Anaconda access Token (required)'
required: true
rtds_webhook_url:
description: Webhook url to generate the doc on readthedocs.
required: false
default: ''
rtds_webhook_token:
description: Webhook token to generate the doc on readthedocs.
required: false
default: ''

jobs:
build-and-publish:
Expand Down Expand Up @@ -60,6 +68,34 @@ jobs:
cond: ${{ startsWith(github.ref, 'refs/tags/v') }}
if_true: 'true'
if_false: 'false'
- name: Determine readthedocs triggering
id: readthedocs-url-triggering
run: |
echo "::group::Read the doc trigerring"
export RTDS_WEBHOOK_TOKEN=''
export RTDS_WEBHOOK_URL=''
if [[ ${RUNNER_OS} = 'Linux' ]]; then
if [[ ${{ inputs.python }} = "10" ]]; then
if [[ ${{ secrets.rtds_webhook_url }} = '' ]]; then
echo "No readthedocs url provided. See https://github.com/dfm/rtds-action"
else
if [[ ${{ secrets.rtds_webhook_token }} = '' ]]; then
echo "No readthedocs token provided. See https://github.com/dfm/rtds-action"
else
export RTDS_WEBHOOK_TOKEN='${{ secrets.anaconda_token }}''
export RTDS_WEBHOOK_URL='${{ secrets.rtds_webhook_url }}''
fi
fi
else
echo "Run readthedocs only on Ubuntu with Python 10"
fi
else
echo "Run readthedocs only on Ubuntu with Python 10"
fi
echo "RTDS_WEBHOOK_TOKEN=${RTDS_WEBHOOK_TOKEN}" >> $GITHUB_OUTPUT
echo "RTDS_WEBHOOK_URL=${RTDS_WEBHOOK_URL}" >> $GITHUB_OUTPUT
echo "::endgroup::"
shell: bash -l {0}
- name: Build and Publish
uses: openalea/action-build-publish-anaconda@main
with:
Expand All @@ -72,3 +108,5 @@ jobs:
publish: ${{ steps.publish.outputs.value }}
label: main
buildoptions: '--no-test'
rtds_webhook_url: ${{ steps.readthedocs-triggering.outputs.RTDS_WEBHOOK_URL }}
rtds_webhook_token: ${{ steps.readthedocs-triggering.outputs.RTDS_WEBHOOK_TOKEN }}