Skip to content

Commit 3b8829a

Browse files
meili-bors[bot]Strift
andauthored
Merge #811
811: Update deployment workflow r=sanders41 a=Strift # Pull Request ## What does this PR do? Update the `documentation.yml` to: - Separate build & deploy steps - Create a CNAME file in the built files folder - Deploy the built files to Github Pages environment - Allow the workflow to run manually Additionally, this PR removes the `CNAME` file from the root of the repo. ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Strift <laurent@meilisearch.com>
2 parents abd1c51 + 48b8e51 commit 3b8829a

2 files changed

Lines changed: 40 additions & 8 deletions

File tree

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
11
name: Documentation
2+
23
on:
34
push:
45
tags:
56
- v*
7+
# Allows to run the workflow manually
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: false
21+
22+
env:
23+
CUSTOM_DOMAIN: python-sdk.meilisearch.com
624

725
jobs:
8-
docs:
26+
build:
927
runs-on: ubuntu-latest
1028
steps:
1129
- uses: actions/checkout@v3
1230
with:
1331
fetch-depth: 0
1432
lfs: true
33+
- name: Setup Github Pages
34+
uses: actions/configure-pages@v3
1535
- name: Install Python
1636
uses: actions/setup-python@v4
1737
with:
18-
python-version: '3.10'
38+
python-version: "3.10"
1939
- name: Install pipenv
2040
run: |
2141
pip install pipx
@@ -29,9 +49,22 @@ jobs:
2949
run: |
3050
pipenv run sphinx-apidoc -f -o docs meilisearch/
3151
pipenv run sphinx-build docs ./docs/_build/html/
32-
- name: Deploy
33-
uses: peaceiris/actions-gh-pages@v3
52+
# CNAME file is required for GitHub pages custom domain
53+
- name: Create CNAME file
54+
run: |
55+
echo "$CUSTOM_DOMAIN" > ./docs/_build/html/CNAME
56+
echo "Created CNAME in ./docs/_build/html/: $CUSTOM_DOMAIN"
57+
- name: Upload artifacts
58+
uses: actions/upload-pages-artifact@v2
3459
with:
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: docs/_build/html
37-
force_orphan: true
60+
path: "./docs/_build/html"
61+
deploy:
62+
needs: build
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v2

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)