mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
132 lines
4.3 KiB
YAML
132 lines
4.3 KiB
YAML
name: Docs
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
changed-files:
|
|
required: true
|
|
type: string
|
|
description: JSON string containing information about changed files
|
|
|
|
jobs:
|
|
Salt:
|
|
name: Build Salt Documentation
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || fromJSON(inputs.changed-files)['docs'] || fromJSON(inputs.changed-files)['salt'] }}
|
|
|
|
container:
|
|
image: python:3.8-slim-buster
|
|
|
|
steps:
|
|
- name: Install System Deps
|
|
run: |
|
|
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
|
apt-get update
|
|
apt-get install -y enchant git gcc imagemagick make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils
|
|
apt-get install -y git/buster-backports
|
|
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Nox
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install nox
|
|
|
|
- name: Install Python Requirements
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
|
|
run:
|
|
nox --install-only --forcecolor -e 'docs-html(compress=False, clean=True)'
|
|
|
|
- name: Build Docs
|
|
env:
|
|
SKIP_REQUIREMENTS_INSTALL: YES
|
|
run: |
|
|
nox --forcecolor -e 'docs-html(compress=False, clean=True)'
|
|
|
|
- name: Store Generated Documentation
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: salt-html-docs
|
|
path: doc/_build/html
|
|
if-no-files-found: error
|
|
|
|
- name: Set Exit Status
|
|
if: always()
|
|
run: |
|
|
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
|
|
echo "${{ job.status }}" > exitstatus/${{ github.job }}-docs-html
|
|
|
|
- name: Upload Exit Status
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: exitstatus
|
|
path: exitstatus
|
|
if-no-files-found: error
|
|
|
|
Manpages:
|
|
name: Build Salt man Pages
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event_name == 'push' || fromJSON(inputs.changed-files)['docs'] }}
|
|
|
|
container:
|
|
image: python:3.8-slim-buster
|
|
|
|
steps:
|
|
- name: Install System Deps
|
|
run: |
|
|
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
|
|
apt-get update
|
|
apt-get install -y enchant git gcc imagemagick make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
|
|
apt-get install -y git/buster-backports
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install Nox
|
|
if: ${{ github.event_name == 'push' || fromJSON(inputs.changed-files)['docs'] }}
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install nox
|
|
|
|
- name: Install Python Requirements
|
|
if: github.event_name == 'push' || fromJSON(inputs.changed-files)['docs']
|
|
env:
|
|
PIP_EXTRA_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/
|
|
run:
|
|
nox --install-only --forcecolor -e 'docs-man(compress=False, update=False, clean=True)'
|
|
|
|
- name: Build Manpages
|
|
if: github.event_name == 'push' || fromJSON(inputs.changed-files)['docs']
|
|
env:
|
|
SKIP_REQUIREMENTS_INSTALL: YES
|
|
run: |
|
|
nox --forcecolor -e 'docs-man(compress=False, update=False, clean=True)'
|
|
|
|
- name: Store Generated Documentation
|
|
if: github.event_name == 'push' || fromJSON(inputs.changed-files)['docs']
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: salt-man-pages
|
|
path: doc/_build/man
|
|
if-no-files-found: error
|
|
|
|
- name: Set Exit Status
|
|
if: always()
|
|
run: |
|
|
python3 -c "import os; os.makedirs('exitstatus', exist_ok=True)"
|
|
echo "${{ job.status }}" > exitstatus/${{ github.job }}-docs-man
|
|
|
|
- name: Upload Exit Status
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: exitstatus
|
|
path: exitstatus
|
|
if-no-files-found: error
|