Skip to content

Commit 294e476

Browse files
authored
Feature/fix_doc_cd (#12)
* ci: fix workflows Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * fix: path in the workflow Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> --------- Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com>
1 parent de99f2c commit 294e476

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

.github/workflows/ci-cd-docs.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- main
1515

1616
jobs:
17-
check:
17+
build:
1818
if: ${{ github.actor != 'dependabot[bot]' }}
1919
name: Check docs build
2020
runs-on: ubuntu-latest
@@ -23,29 +23,29 @@ jobs:
2323
- name: Install Python
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: "3.12"
26+
python-version: '3.x'
2727
- name: Install package with optional dependency 'doc'
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install .[doc]
3131
- name: Run MkDocs build
3232
working-directory: ./docs
3333
run: mkdocs build
34+
- name: Upload Pages artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: "docs/site/"
3438
publish:
3539
if: success() && startsWith(github.ref, 'refs/tags')
36-
name: Publish docs on GH Pages
40+
needs: build
41+
permissions:
42+
pages: write
43+
id-token: write
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
3747
runs-on: ubuntu-latest
3848
steps:
39-
- uses: actions/checkout@v4
40-
- name: Install Python
41-
uses: actions/setup-python@v5
42-
with:
43-
python-version: "3.12"
44-
- name: Install package with optional dependency 'doc'
45-
run: |
46-
python -m pip install --upgrade pip
47-
pip install .[doc]
48-
- name: Run MkDocs deploy
49-
working-directory: ./docs
50-
run: mkdocs gh-deploy
51-
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

.github/workflows/ci-cd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Set up Python version
2424
uses: actions/setup-python@v5
2525
with:
26-
python-version: "3.12"
26+
python-version: '3.x'
2727
- name: Install extra dependencies
2828
run: |
2929
python -m pip install --upgrade pip
@@ -36,6 +36,7 @@ jobs:
3636
- name: Run pre-commit hooks
3737
run: pre-commit run --all-files
3838
publish:
39+
needs: pre-commit
3940
if: success() && startsWith(github.ref, 'refs/tags')
4041
name: Publish release to PyPI
4142
runs-on: ubuntu-latest
@@ -48,7 +49,7 @@ jobs:
4849
- name: Set up Python version
4950
uses: actions/setup-python@v5
5051
with:
51-
python-version: "3.12"
52+
python-version: '3.x'
5253
- name: Build package
5354
run: |
5455
python -m pip install --upgrade build

0 commit comments

Comments
 (0)