Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 15 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,26 @@ on:
- main

jobs:
deploy:
name: Deploy
build:
name: Build & deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11.6'

- name: Install Dependencies
run: pip install ansible sphinx sphinx_rtd_theme

- name: Print Ansible version
run: ansible --version

- name: Prepare Ansible requirements file
run: make requirements

- name: Install Ansible roles
run: make install

- name: Prepare Sphinx templates
run: make doc/sphinx-template

- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
# see details (matrix, python-version, python-version-file, etc.)
# https://github.com/actions/setup-python
- name: Install poetry
uses: abatilo/actions-poetry@v4
- name: Generate docs
run: make doc
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: html-docs
path: doc/_build/html/

# Only difference to pull-requests
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Pull Requests

on:
pull_request:
branches:
- main

jobs:
build:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
# see details (matrix, python-version, python-version-file, etc.)
# https://github.com/actions/setup-python
- name: Install poetry
uses: abatilo/actions-poetry@v4
- name: Generate docs
run: make doc
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: html-docs
path: doc/_build/html/
23 changes: 6 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
.DEFAULT_GOAL := help

ROLES_DOC := $(doc/%.rst)

all: doc

help: ## display this help
@cat $(MAKEFILE_LIST) | grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' | \
sort -k1,1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

clean: ## cleanup
$(shell \
cd doc; \
make clean; \
cd ..; \
)

doc: $(ROLES_DOC) ## create html documentation
cd doc && make html

doc/%.rst: doc/sphinx-template
mk/yml2rst $* $< $@

doc/sphinx-template:
git clone https://github.com/adfinis-sygroup/adsy-sphinx-template doc/sphinx-template
cd doc && make clean

.PHONY: all help clean requirements install doc
doc: ## create html documentation
rm -rf doc/_build/
poetry install --no-root
poetry run sh -c 'cd doc && make html'

.PHONY: all help clean doc
# vim: set noexpandtab ts=4 sw=4 ft=make :
Loading
Loading