Skip to content

Commit 8a5299c

Browse files
authored
Merge pull request #8 from fractal-analytics-platform/add-sources
Try out new GHA
2 parents 0150e5c + d6f11b2 commit 8a5299c

File tree

13 files changed

+185
-91
lines changed

13 files changed

+185
-91
lines changed
Lines changed: 91 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,116 @@
1-
name: docs
1+
name: Build and deploy
22

33
on:
44
push:
55
branches: ["main"]
66
pull_request:
77
branches: ["main"]
88

9+
# Re-run every Tuesday at 6AM
10+
# schedule:
11+
# - cron: "0 6 * * 2"
12+
13+
# Re-run on demand:
14+
workflow_dispatch:
15+
916
jobs:
1017

11-
mkdocs-link-check:
12-
runs-on: ubuntu-22.04
13-
steps:
14-
- uses: actions/checkout@v4
15-
- name: mkdocs-link-check (soft)
16-
uses: byrnereese/[email protected]
17-
continue-on-error: true
18-
with:
19-
recurse: 'yes'
20-
verbose-mode: 'yes'
21-
22-
docs:
23-
name: "Deploy docs"
24-
runs-on: ubuntu-22.04
25-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
18+
build-and-deploy:
19+
20+
runs-on: ubuntu-24.04
2621

2722
steps:
23+
2824
- uses: actions/checkout@v4
25+
with:
26+
path: MAIN
2927

28+
- name: Set fractal-web reference
29+
run: |
30+
FRACTAL_WEB_REFERENCE=$(cat MAIN/fractal-web-reference.txt)
31+
echo "FRACTAL_WEB_REFERENCE=$FRACTAL_WEB_REFERENCE" >> $GITHUB_ENV
32+
33+
- run: echo ${{ env.FRACTAL_WEB_REFERENCE }}
34+
35+
- uses: actions/checkout@v4
36+
with:
37+
repository: fractal-analytics-platform/fractal-web
38+
ref: ${{ env.FRACTAL_WEB_REFERENCE }}
39+
path: WEB
40+
sparse-checkout: |
41+
components
42+
tasks-list
43+
3044
- uses: actions/setup-python@v5
3145
with:
32-
python-version: '3.10'
46+
python-version: '3.11'
3347
cache: pip
3448

35-
- name: Install requirements
36-
run: python -m pip install -r requirements.txt
49+
# MKDocs build
3750

38-
- name: Deploy docs
39-
uses: mhausenblas/mkdocs-deploy-gh-pages@master
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
REQUIREMENTS: docs/doc-requirements.txt
51+
- name: Install dependencies
52+
run: python -m pip install -r MAIN/requirements.txt
4353

54+
- name: MKDocs build
55+
run: mkdocs build --config-file MAIN/mkdocs.yml --strict --site-dir ./site
4456

45-
docs-build:
46-
name: "Test docs build"
47-
runs-on: ubuntu-22.04
48-
if: ${{ github.event_name != 'push' || github.ref != 'refs/heads/main' }}
57+
- run: mv MAIN/site ./site
4958

50-
steps:
51-
- uses: actions/checkout@v4
59+
# Retrieve remote task-list data
5260

53-
- uses: actions/setup-python@v5
61+
- name: Install requirements
62+
run: python3 -m pip install -r MAIN/tasks_data_retrieval/requirements.txt
63+
64+
- name: Fetch tasks data
65+
run: python3 -u MAIN/tasks_data_retrieval/create_tasks_data.py
66+
67+
- run: cat MAIN/tasks_data_retrieval/tasks.json
68+
69+
- uses: actions/setup-node@v4
5470
with:
55-
python-version: '3.10'
56-
cache: pip
71+
node-version: 20
72+
cache: npm
73+
cache-dependency-path: WEB/package-lock.json
5774

58-
- name: Install requirements
59-
run: python -m pip install -r requirements.txt
75+
- name: Install main fractal-web dependencies
76+
run: |
77+
cd WEB
78+
npm install
6079
61-
- name: MKDocs build
62-
run: mkdocs build --config-file mkdocs.yml
80+
- name: Install components dependencies
81+
run: |
82+
cd WEB/components
83+
npm install
84+
85+
- name: Install tasks-list dependencies
86+
run: |
87+
cd WEB/tasks-list
88+
npm install
89+
90+
- name: Move tasks.json file to tasks-list/src
91+
run: mv MAIN/tasks_data_retrieval/tasks.json WEB/tasks-list/src/
92+
93+
- name: Build tasks-list page
94+
run: |
95+
cd WEB/tasks-list
96+
npm run build
97+
98+
- name: Move tasks-list built files in docs site
99+
run: mv WEB/tasks-list/build/ site/task-table
100+
101+
- name: Set last-updated timestamp
102+
run: |
103+
CURRENT_DATE=$(date +"%Y-%m-%d %H:%M %Z")
104+
echo "$CURRENT_DATE"
105+
sed -i'.bak1' "s/LASTUPDATEDPLACEHOLDER/$CURRENT_DATE/" site/available_tasks/index.html
106+
sed -i'.bak2' "s/FRACTALWEBREFERENCEPLACEHOLDER/${{ env.FRACTAL_WEB_REFERENCE }}/" site/available_tasks/index.html
107+
rm site/available_tasks/index.html.bak1 site/available_tasks/index.html.bak2
108+
109+
- run: ls -lh site/*
110+
111+
- name: Deploy docs
112+
if: ${{ ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.event.ref == 'refs/heads/main' }}
113+
uses: peaceiris/actions-gh-pages@v4
114+
with:
115+
github_token: ${{ secrets.GITHUB_TOKEN }}
116+
publish_dir: ./site

.github/workflows/links.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/task_list.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

docs/available_tasks.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
hide:
3+
- navigation
4+
- toc
5+
- title
6+
---
7+
8+
<style>
9+
.md-typeset h1,
10+
.md-content__button {
11+
display: none;
12+
}
13+
</style>
14+
15+
<style>
16+
.tasks-iframe{
17+
width: 100%;
18+
height: 850px;
19+
border: 0;
20+
}
21+
</style>
22+
23+
<iframe src="../task-table/" class="tasks-iframe">
24+
</iframe>
25+
26+
27+
(last updated: LASTUPDATEDPLACEHOLDER; `fractal-web` version: FRACTALWEBREFERENCEPLACEHOLDER)

docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
layout: default
33
---
44

5+
<style>
6+
.md-typeset h1,
7+
.md-content__button {
8+
display: none;
9+
}
10+
</style>
11+
12+
513
Fractal is a framework developed at the [BioVisionCenter](https://www.biovisioncenter.uzh.ch/en.html) to process bioimaging data at scale in the OME-Zarr format and prepare the images for interactive visualization.
614

715
![Fractal overview](https://github.com/user-attachments/assets/666c8797-2594-4b8e-b1d2-b43fca66d1df)

fractal-web-reference.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.13.0

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ nav:
4646
- Fractal V2 Changes: version_2/
4747
- Build Your Own Fractal Task: build_your_own_fractal_task.md
4848
- Deploy Fractal Server & Web: run_fractal.md
49+
- Available tasks: available_tasks.md
4950

5051
# Include some page, without including them in the ToC
5152
# not_in_nav: something.md

tasks/data_retrieval/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

tasks_data_retrieval/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tasks.json
2+
venv

tasks/data_retrieval/create_tasks_data.py renamed to tasks_data_retrieval/create_tasks_data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def _get_task_type(
196196
"input_types",
197197
"output_types",
198198
"docs_link",
199+
"docs_info",
199200
]
200201
COLUMN_DEFAULTS = {
201202
"input_types": {},
@@ -253,7 +254,7 @@ def _get_task_type(
253254
print(f"END processing {source=} - version={pkg_version}' - added {ntasks} tasks - elapsed {t_end-t_start:.3f} s.")
254255
print()
255256

256-
output_file = Path(__file__).parent / "tasks_data.json"
257+
output_file = Path(__file__).parent / "tasks.json"
257258
with output_file.open("w") as f:
258259
json.dump(TASK_GROUPS, f, indent=2)
259260

0 commit comments

Comments
 (0)