Skip to content

Commit 4fc58e5

Browse files
Change deployment on SSP Cloud with new filesystem organization (#227)
* fix ci problem * Tweak * extension * prod * Automated changes * ajoute les headers * Automated changes * done * Automated changes Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 12965ba commit 4fc58e5

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

.github/workflows/netlify-test.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ jobs:
2727
conda list
2828
- name: Build to md
2929
run: |
30+
git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff
31+
python build/tweak_render.py
3032
quarto render --to hugo
3133
mv content/course/manipulation/index.md content/course/manipulation/_index.md
3234
mv content/course/visualisation/index.md content/course/visualisation/_index.md
3335
mv content/course/modelisation/index.md content/course/modelisation/_index.md
34-
#git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff.txt
35-
#cat diff.txt
36-
#Rscript -e 'source("./build/build_light.R")'
3736
hugo mod graph
3837
hugo -D --themesDir themes -t github.com
3938
- name: Clean files with Python function
@@ -77,8 +76,6 @@ jobs:
7776
run: |
7877
git config user.name 'github-actions[bot]'
7978
git config user.email 'github-actions[bot]@users.noreply.github.com'
80-
# git config user.email github-actions@github.com
81-
#git checkout ${BRANCHE_REF}
8279
git status
8380
find notebooks -type f -name "*.ipynb" | xargs git add
8481
git commit -m "Automated changes";
@@ -103,6 +100,8 @@ jobs:
103100
conda list
104101
- name: Convert in ipynb with Jupytext
105102
run: |
103+
git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff
104+
python build/tweak_render.py
106105
quarto render content --to ipynb --execute
107106
mkdir -p corrections
108107
python build/move_files.py corrections

.github/workflows/prod.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ jobs:
4545
mkdir -p notebooks
4646
python build/move_files.py notebooks
4747
- name: Install npm
48-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
4948
uses: actions/setup-node@v2
5049
with:
5150
node-version: '12'
5251
- name: Deploy to Netlify
53-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
5452
# NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID added in the repo's secrets
5553
env:
5654
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}

build/tweak_render.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import yaml
2+
3+
with open("_quarto.yml", "r") as stream:
4+
config = yaml.load(stream, Loader=yaml.FullLoader)
5+
6+
with open('diff') as f:
7+
lines = f.read().splitlines()
8+
9+
lines = [l for l in lines if l.endswith('.qmd') ]
10+
lines += [f"content/course/{dir}/index.md" for dir in ["manipulation","visualisation","modelisation"]]
11+
12+
config['project']['render'] = lines
13+
14+
with open('_quarto.yml', 'w') as outfile:
15+
yaml.dump(config, outfile, default_flow_style=False)
16+
17+
print("Done")

sspcloud/generate-doc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ def generate_block(name, abstract, authors, types, tags, category,
8383
if section_md["chapters"]:
8484
for chapter in section_md["chapters"]:
8585
# Build chapter block if notebook exists
86-
MD_PATH = os.path.join(PROJECT_DIR, "content", "course", section, f"{chapter}.Rmd")
86+
MD_PATH = os.path.join(PROJECT_DIR, "content", "course", section, chapter, "index.qmd")
8787

8888
if os.path.isfile(MD_PATH):
8989
name, abstract = extract_metadata_md(MD_PATH)
9090

91-
init_args = urllib.parse.quote(f"{section} {chapter}")
91+
init_args = urllib.parse.quote(f"{section} {chapter}.ipynb")
9292
launcher_url = LAUNCHER_TMPLT.format(init_args=init_args)
9393

9494
chapter_doc = generate_block(name=name,

0 commit comments

Comments
 (0)