Skip to content

Commit d72dd43

Browse files
committed
split docs into workflow
1 parent 23982fe commit d72dd43

File tree

2 files changed

+87
-32
lines changed

2 files changed

+87
-32
lines changed

.github/workflows/publish_docs.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Publish
2+
name: publish workflow
3+
4+
on:
5+
# Triggers the workflow on push events but only for the master branch
6+
push:
7+
branches: [main]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
25+
jobs:
26+
# Build job
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
33+
- name: setup Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: "3.10"
37+
38+
- name: Setup Pages
39+
id: pages
40+
uses: actions/configure-pages@v3
41+
42+
- name: Install and configure Poetry
43+
uses: GNS-Science/install-poetry@main
44+
with:
45+
virtualenvs-create: true
46+
virtualenvs-in-project: true
47+
installer-parallel: true
48+
49+
#----------------------------------------------
50+
# load cached venv if cache exists
51+
#----------------------------------------------
52+
- name: Load cached venv
53+
id: cached-poetry-dependencies
54+
uses: actions/cache@v3
55+
with:
56+
path: .venv
57+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
58+
59+
#----------------------------------------------
60+
# install dependencies if cache does not exist
61+
#----------------------------------------------
62+
- name: Install dependencies
63+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
64+
run: |
65+
poetry install --with doc
66+
67+
- name: Build documentation
68+
run: |
69+
poetry run mkdocs build
70+
71+
- name: Upload artifact
72+
uses: actions/upload-pages-artifact@v2
73+
with:
74+
path: ./site
75+
76+
# Deployment job
77+
deploy:
78+
environment:
79+
name: github-pages
80+
url: ${{ steps.deployment.outputs.page_url }}
81+
runs-on: ubuntu-latest
82+
needs: build
83+
steps:
84+
- name: Deploy to GitHub Pages
85+
id: deployment
86+
uses: actions/deploy-pages@v2

.github/workflows/release.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@ on:
1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
1414

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16-
permissions:
17-
contents: read
18-
pages: write
19-
id-token: write
20-
21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23-
concurrency:
24-
group: "pages"
25-
cancel-in-progress: false
26-
27-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2815
jobs:
2916
# Allows you to run this workflow manually from the Actions tab
3017
call-test-workflow:
@@ -69,24 +56,6 @@ jobs:
6956
virtualenvs-in-project: true
7057
installer-parallel: true
7158

72-
- name: build documentation
73-
run: |
74-
poetry install --with doc
75-
poetry run mkdocs build
76-
77-
- name: Deploy to GitHub Pages
78-
uses: actions/deploy-pages@v2
79-
with:
80-
path: ./site
81-
82-
- name: Build wheels and source tarball
83-
run: >-
84-
poetry build
85-
86-
- name: show temporary files
87-
run: >-
88-
ls -l
89-
9059
- name: create github release
9160
id: create_release
9261
uses: GNS-Science/action-gh-release@master
@@ -103,4 +72,4 @@ jobs:
10372
with:
10473
user: __token__
10574
password: ${{ secrets.PYPI_API_TOKEN }}
106-
skip_existing: true
75+
skip-existing: true

0 commit comments

Comments
 (0)