From f1795d0b8b15d7856c28a023d29aeca1b0d23773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Mart=C3=ADn=20Bl=C3=A1zquez?= Date: Thu, 21 Dec 2023 17:27:01 +0100 Subject: [PATCH] Add `docs` workflow (#179) --- .github/workflows/docs.yml | 38 ++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..3520e2b949 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +name: Publish documentation + +on: + push: + branches: + - main + - gh-pages + tags: + - "**" + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + # Looks like it's not working very well for other people: + # https://github.com/actions/setup-python/issues/436 + # cache: "pip" + # cache-dependency-path: pyproject.toml + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: pip install -e .[docs] + - name: Set git credentials + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.name "${{ github.actor }}@users.noreply.github.com" + + - run: mike deploy dev --push + if: github.ref == 'refs/heads/main' + + - run: mike deploy latest ${{ github.ref_name }} --push + if: startsWith(github.ref, 'refs/tags/') diff --git a/mkdocs.yml b/mkdocs.yml index 46e1831687..ddfa3b010a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,7 +18,7 @@ extra_css: theme: name: material logo: assets/logo.svg - favicon: assets/distilabel-icon.svg + favicon: assets/logo.svg features: - navigation.instant - navigation.tabs