From 1f4940acbb326a3c37e0aaa0d4d39b41e8a81fb1 Mon Sep 17 00:00:00 2001 From: Strift Date: Tue, 25 Jul 2023 16:01:11 +0200 Subject: [PATCH 1/5] Update documentation workflow to deploy with Github pages --- .github/workflows/documentation.yml | 45 +++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d36f84a2..8927c92b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,17 +1,37 @@ name: Documentation + on: push: tags: - v* + # Allows to run the workflow manually + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +env: + CUSTOM_DOMAIN: python-sdk.meilisearch.com jobs: - docs: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true + - name: Setup Github Pages + uses: actions/configure-pages@v3 - name: Install Python uses: actions/setup-python@v4 with: @@ -29,9 +49,22 @@ jobs: run: | pipenv run sphinx-apidoc -f -o docs meilisearch/ pipenv run sphinx-build docs ./docs/_build/html/ - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + # CNAME file is required for GitHub pages custom domain + - name: Create CNAME file + run: | + echo "$CUSTOM_DOMAIN" > ./docs/_build/html/CNAME + echo "Created CNAME in ./docs/_build/html/: $CUSTOM_DOMAIN" + - name: Upload artifacts + uses: actions/upload-pages-artifact@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/_build/html - force_orphan: true + path: './docs/_build/html' + deploy: + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 From 329fda93c2a9ed323275c74a0fc0c8aa05d0472e Mon Sep 17 00:00:00 2001 From: Strift Date: Tue, 25 Jul 2023 16:01:31 +0200 Subject: [PATCH 2/5] Remove CNAME file from root --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 4f7c31d6..00000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -python-sdk.meilisearch.com/ From 97dc9ce1b944e189d4b4965a46b523caa66cac3b Mon Sep 17 00:00:00 2001 From: Strift Date: Tue, 25 Jul 2023 16:56:11 +0200 Subject: [PATCH 3/5] Update workflow trigger to allow testing --- .github/workflows/documentation.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8927c92b..b37a2e82 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,9 +1,8 @@ name: Documentation on: - push: - tags: - - v* + # Temporary change to test action before merging in `main` + pull_request: # Allows to run the workflow manually workflow_dispatch: @@ -35,7 +34,7 @@ jobs: - name: Install Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: "3.10" - name: Install pipenv run: | pip install pipx @@ -57,7 +56,7 @@ jobs: - name: Upload artifacts uses: actions/upload-pages-artifact@v2 with: - path: './docs/_build/html' + path: "./docs/_build/html" deploy: needs: build environment: From 6a4a06eb848033a81970b30c8d95a2cab52e77ec Mon Sep 17 00:00:00 2001 From: Strift Date: Tue, 25 Jul 2023 17:16:12 +0200 Subject: [PATCH 4/5] Add todos to remove code before merging --- .github/workflows/documentation.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b37a2e82..93b10c6b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,6 +1,11 @@ name: Documentation on: + # TODO: uncomment before merging PR + # push: + # tags: + # - v* + # TODO: remove before merging PR # Temporary change to test action before merging in `main` pull_request: # Allows to run the workflow manually From 61b5f2eda28e998e27849f54afd5efaf4d949ef2 Mon Sep 17 00:00:00 2001 From: Strift Date: Wed, 26 Jul 2023 10:57:46 +0200 Subject: [PATCH 5/5] Disable workflow on PR --- .github/workflows/documentation.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 93b10c6b..4b2a595f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,13 +1,9 @@ name: Documentation on: - # TODO: uncomment before merging PR - # push: - # tags: - # - v* - # TODO: remove before merging PR - # Temporary change to test action before merging in `main` - pull_request: + push: + tags: + - v* # Allows to run the workflow manually workflow_dispatch: