From c8e5bc9df701fd80d53211d57dfab2a24e97a941 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Thu, 24 Oct 2024 11:58:41 +0200 Subject: [PATCH] ci: Add actions to automatically build documentation after changes --- .github/workflows/sphinx.yml | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/sphinx.yml diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml new file mode 100644 index 000000000..906b7fa72 --- /dev/null +++ b/.github/workflows/sphinx.yml @@ -0,0 +1,46 @@ +name: Sphinx + +on: + push: + branches: + - test-sphinx + paths: + - '.github/workflows/sphinx.yml' + - 'examples/**' + - 'skore/**' + - 'sphinx/**' + +permissions: + contents: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + sphinx: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - name: Setup + run: | + python -m pip install --upgrade pip + python -m pip install './skore[sphinx]' + + - name: Build + run: | + (cd sphinx && make html) + + rm -rf docs/latest + mv sphinx/build/html docs/latest + - name: Commit + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git add docs/latest + git commit -m 'docs: Build documentation triggered by ${{ github.sha }} ' + git push