Skip to content

Commit

Permalink
.github: Move build-docs to his own workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
TeddyAndrieux committed Oct 8, 2024
1 parent 70667e5 commit 127b784
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 38 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Build docs"

on:
workflow_call:
inputs:
ref:
description: "the git revision to checkout"
default: ${{ github.ref }}
required: false
type: string
secrets:
ARTIFACTS_USER:
required: true
ARTIFACTS_PASSWORD:
required: true

jobs:
docs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Install Python 3
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install deps
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install --no-install-recommends -y plantuml
python3.10 -m pip install tox~=4.0.19
- name: Build documentation for ReadTheDocs
env:
# Fake that we are building in a ReadTheDocs environment
READTHEDOCS: "True"
run: tox --workdir /tmp/tox -e docs -- html
- name: Copy generated docs for ReadTheDocs
run: mkdir -p artifacts/docs/readthedocs && cp -r docs/_build/* artifacts/docs/readthedocs/
- name: Build documentation with Scality theme
run: rm -rf docs/_build && tox --workdir /tmp/tox -e docs -- html
- name: Copy generated docs with Scality theme
run: cp -r docs/_build/* artifacts/docs/ && cp CHANGELOG.md artifacts/docs/
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: artifacts
45 changes: 7 additions & 38 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,42 +147,11 @@ jobs:
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: artifacts

docs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Install Python 3
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install deps
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install --no-install-recommends -y plantuml
python3.10 -m pip install tox~=4.0.19
- name: Build documentation for ReadTheDocs
env:
# Fake that we are building in a ReadTheDocs environment
READTHEDOCS: "True"
run: tox --workdir /tmp/tox -e docs -- html
- name: Copy generated docs for ReadTheDocs
run: mkdir -p artifacts/docs/readthedocs && cp -r docs/_build/* artifacts/docs/readthedocs/
- name: Build documentation with Scality theme
run: rm -rf docs/_build && tox --workdir /tmp/tox -e docs -- html
- name: Copy generated docs with Scality theme
run: cp -r docs/_build/* artifacts/docs/ && cp CHANGELOG.md artifacts/docs/
- name: Upload artifacts
uses: scality/action-artifacts@v4
with:
method: upload
url: https://artifacts.scality.net
user: ${{ secrets.ARTIFACTS_USER }}
password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: artifacts
build-docs:
uses: ./.github/workflows/build-docs.yaml
secrets: inherit
with:
ref: ${{ inputs.ref }}

lint:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -581,7 +550,7 @@ jobs:
needs:
- build
- build-shell-ui
- docs
- build-docs
- lint
- unit_tests_ui
- unit_tests_shell_ui
Expand Down Expand Up @@ -615,7 +584,7 @@ jobs:
needs:
- build
- build-shell-ui
- docs
- build-docs
- lint
- unit_tests_ui
- unit_tests_shell_ui
Expand Down

0 comments on commit 127b784

Please sign in to comment.