Skip to content
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
7 changes: 7 additions & 0 deletions .github/workflows/_shared-docs-build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ on:
`conf.py` in `html_theme_options`
required: false
type: string
init-append-conf-py:
description: |
If provided, this text will be appended to the generated `conf.py` as-is.
required: false
type: string
artifact-name:
description: The name of the artifact to upload.
required: false
Expand Down Expand Up @@ -312,6 +317,7 @@ jobs:
extra-conf: ${{ inputs.init-extra-conf }}
extra-html-context: ${{ inputs.init-extra-html-context }}
extra-html-theme-options: ${{ inputs.init-extra-html-theme-options }}
append-conf-py: ${{ inputs.init-append-conf-py }}

- name: Build BASE
id: build-base
Expand Down Expand Up @@ -356,6 +362,7 @@ jobs:
extra-conf: ${{ inputs.init-extra-conf }}
extra-html-context: ${{ inputs.init-extra-html-context }}
extra-html-theme-options: ${{ inputs.init-extra-html-theme-options }}
append-conf-py: ${{ inputs.init-append-conf-py }}

- name: Build HEAD
id: build-head
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/_shared-docs-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ on:
`conf.py` in `html_theme_options`
required: false
type: string
init-append-conf-py:
description: |
If provided, this text will be appended to the generated `conf.py` as-is.
required: false
type: string
artifact-upload:
description: Whether or not to upload the build as an artifact.
type: boolean
Expand Down Expand Up @@ -230,6 +235,7 @@ jobs:
extra-conf: ${{ inputs.init-extra-conf }}
extra-html-context: ${{ inputs.init-extra-html-context }}
extra-html-theme-options: ${{ inputs.init-extra-html-theme-options }}
append-conf-py: ${{ inputs.init-append-conf-py }}

- name: Build
id: build
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/test-action-build-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
- ''
extra-html-theme-options:
- ''
append-conf-py:
- ''
intersphinx-links: ['']
squash-hierarchy:
- false
Expand Down Expand Up @@ -100,6 +102,9 @@ jobs:
extra-html-theme-options: |
foo=baz
long=Yet "another" long 'quotes' text
append-conf-py: |
# This is a special comment.
# FOO BAR 1234

steps:
- name: Checkout
Expand Down Expand Up @@ -137,6 +142,7 @@ jobs:
extra-conf: ${{ matrix.extra-conf }}
extra-html-context: ${{ matrix.extra-html-context }}
extra-html-theme-options: ${{ matrix.extra-html-theme-options }}
append-conf-py: ${{ matrix.append-conf-py }}

- name: assert
env:
Expand Down Expand Up @@ -233,5 +239,8 @@ jobs:
# TODO Check extra-html-context
# TODO Check extra-html-theme-options

${{ matrix.append-conf-py && 'true' || 'false' }} && (grep -E '^# This is a special comment\.$' conf.py || exit 1)
${{ matrix.append-conf-py && 'true' || 'false' }} && (grep -E '^# FOO BAR 1234$' conf.py || exit 1)

# This must be the last line
exit 0
14 changes: 14 additions & 0 deletions actions/ansible-docs-build-init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ inputs:
A newline separated list of `key=value` entries that will be added to the generated
`conf.py` in `html_theme_options`
required: false
append-conf-py:
description: |
If provided, this text will be appended to the generated `conf.py` as-is.
required: false
outputs:
build-script:
description: The path of the build script to execute.
Expand All @@ -121,6 +125,7 @@ runs:
_INPUT_EXTRA_CONF: ${{ inputs.extra-conf }}
_INPUT_EXTRA_HTML_CONTEXT: ${{ inputs.extra-html-context }}
_INPUT_EXTRA_HTML_THEME_OPTIONS: ${{ inputs.extra-html-theme-options }}
_INPUT_APPEND_CONF_PY: ${{ inputs.append-conf-py }}
shell: bash
run: |
echo "::group::Installing antsibull-docs"
Expand Down Expand Up @@ -229,6 +234,15 @@ runs:
echo "::endgroup::"
fi

if [[ "${_INPUT_APPEND_CONF_PY}" != "" ]]; then
echo "::group::Appending to conf.py"
echo "${_INPUT_APPEND_CONF_PY}" >> "${{ inputs.dest-dir }}/conf.py"
echo "Content of ${{ inputs.dest-dir }}/conf.py:"
echo ""
cat "${{ inputs.dest-dir }}/conf.py"
echo "::endgroup::"
fi

echo "::group::Install additional requirements"
pip install -r "${{ inputs.dest-dir }}/requirements.txt"
echo "::endgroup::"
Expand Down