forked from ansible/docsite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |