diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..c94ba97 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,26 @@ +name: Docs + +on: + release: + types: [published] + + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: build docs + run: | + pip install tox + tox -e docs + + - name: publish + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/_build + publish_branch: netlify diff --git a/tox.ini b/tox.ini index 6225fdd..c6b5cf4 100644 --- a/tox.ini +++ b/tox.ini @@ -55,3 +55,14 @@ deps = commands = pytest --cov=src/djlint --cov-branch --cov-report xml:coverage.xml --cov-report term-missing skip_install: false + +[testenv:docs] +changedir = docs +deps = + sphinx + myst-parser + sphinx_copybutton +commands = sphinx-build -E -b html . _build +setenv = + PYTHONDONTWRITEBYTECODE=1 + DEBUG=False