Skip to content
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
20 changes: 10 additions & 10 deletions .github/workflows/docbuild-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ on:
description: 'The pandas version to override'
required: false
type: string
publish_prod:
description: 'Publish to production'
type: boolean
default: false

env:
ENV_FILE: environment.yml
PANDAS_CI: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PANDAS_VERSION: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}"
PANDAS_VERSION_OVERRIDE: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || '' }}"

permissions:
contents: read
Expand All @@ -45,13 +47,11 @@ jobs:
steps:
- name: Set pandas version
run: |
echo "PANDAS_VERSION=${GITHUB_REF_NAME:1}" >> "$GITHUB_ENV"
if: github.event_name != 'workflow_dispatch'

- name: Show environment variables
run: |
echo "PANDAS_VERSION=${{ env.PANDAS_VERSION }}"
echo "PANDAS_VERSION_OVERRIDE=${{ env.PANDAS_VERSION_OVERRIDE }}"
if [ -n "${{ github.event.inputs.version }}" ]; then
echo "PANDAS_VERSION=${{ github.event.inputs.version }}" >> "$GITHUB_ENV"
else
echo "PANDAS_VERSION=${GITHUB_REF_NAME:1}" >> "$GITHUB_ENV"
fi

- name: Checkout
uses: actions/checkout@v6
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:

- name: Upload prod docs
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/version/${{ env.PANDAS_VERSION }}
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && env.PANDAS_VERSION_OVERRIDE != '')
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (inputs.publish_prod == 'true') }}

- name: Move docs into site directory
run: mv doc/build/html web/build/docs
Expand Down
Loading