From 8a8835cc0e41854e790f8ded55d32d1ec9d1c4bd Mon Sep 17 00:00:00 2001 From: Don Naro Date: Thu, 5 Jan 2023 15:10:16 +0000 Subject: [PATCH] issue #131 for package docs --- .github/workflows/publish-package-docs.yaml | 94 +++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/workflows/publish-package-docs.yaml diff --git a/.github/workflows/publish-package-docs.yaml b/.github/workflows/publish-package-docs.yaml new file mode 100644 index 00000000..0a846de6 --- /dev/null +++ b/.github/workflows/publish-package-docs.yaml @@ -0,0 +1,94 @@ +name: Ansible package docs build +on: + workflow_dispatch: + inputs: + github_fork: + description: 'GitHub Fork' + required: true + default: 'ansible' + github_branch: + description: 'GitHub Branch' + required: true + default: 'devel' + language: + type: choice + description: 'Language' + required: true + default: 'english' + options: + - 'english' + - 'japanese' + package_version: + type: choice + description: 'Ansible Version' + required: true + default: 'devel' + options: + - 'devel' + - '8' + - '7' + - '6' + - '5' + - '4' + - '3' + - '2.10' + latest_symlink: + type: boolean + description: 'Add latest symlink?' + required: true + +jobs: + build-package-docs: + runs-on: ubuntu-latest + env: + PACKAGE_VERSION: "${{ github.event.inputs.package_version }}" + LANGUAGE: ${{ github.event.inputs.language}} + steps: + - name: Checkout Ansible + uses: actions/checkout@v3 + with: + repository: ${{ github.event.inputs.github_fork }}/ansible + ref: ${{ github.event.inputs.github_branch }} + path: build-directory + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + + - name: Output Python info + run: python --version --version && which python + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools six wheel + + - name: Install project requirements + run: | + pushd build-directory + python -m pip install -r requirements.txt + python -m pip install -r docs/docsite/requirements.txt + popd + + - name: Set the COLLECTION_LIST variable + run: | + if [ ${PACKAGE_VERSION} == "devel" ]; then + echo COLLECTION_LIST="" >> $GITHUB_ENV + else + echo COLLECTION_LIST="${PACKAGE_VERSION}" >> $GITHUB_ENV + fi + + - name: Set the VERSION variable + run: | + if [ ${LANGUAGE} == "english" ]; then + echo VERSION="${PACKAGE_VERSION}" >> $GITHUB_ENV + elif [ ${LANGUAGE} == "japanese" ]; then + echo VERSION="${PACKAGE_VERSION}_ja" >> $GITHUB_ENV + fi + + - name: Build the docs + run: | + pushd build-directory/docs/docsite + make webdocs ANSIBLE_VERSION="${COLLECTION_LIST}" + popd