Skip to content

Commit

Permalink
issue ansible#131 for package docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oraNod committed Jan 26, 2023
1 parent 09a1635 commit 8a8835c
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/publish-package-docs.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8a8835c

Please sign in to comment.