@@ -13,32 +13,43 @@ jobs:
1313 runs-on : ubuntu-latest
1414 if : ${{ !github.event.pull_request.head.repo.fork }}
1515 steps :
16+
1617 - uses : actions/checkout@v4
1718 with :
1819 fetch-depth : 0
1920 ref : ${{ github.event.pull_request.head.ref }}
2021 repository : ${{github.event.pull_request.head.repo.full_name}}
22+
2123 - name : Configure safe.directory # Workaround for actions/checkout#760
2224 run : git config --global --add safe.directory /__w/python-datascientist/python-datascientist
25+
2326 - name : Install system dependencies
2427 run : |
2528 sudo ./build/requirements.sh
26- - name : Install the latest version of uv and set the python version to 3.13t
29+
30+ - name : Install the latest version of uv
2731 uses : astral-sh/setup-uv@v6
2832 with :
29- python-version : " 3.12"
30- enable-cache : true
31- cache-dependency-glob : " uv.lock"
32- - uses : quarto-dev/quarto-actions/setup@v2
33- - run : |
34- quarto --version
33+ version : " latest"
34+ python-version : 3.12
35+
36+ - name : Restore environment
37+ run : uv sync
38+
39+ # Step 3: Set up Quarto
40+ - name : Set up quarto
41+ uses : quarto-dev/quarto-actions/setup@v2
42+
43+ - name : Install SpaCy corpus and check quarto version
44+ run : |
45+ uv run spacy download en_core_web_sm
46+ uv run quarto --version
47+
3548 - name : Prepare directory
3649 run : |
3750 rm _quarto.yml
3851 cp _quarto-prod.yml _quarto.yml
39- - name : Install Python dependencies
40- run : |
41- uv sync
52+
4253 - name : Render website
4354 env :
4455 API_INPI_USERNAME : ${{ secrets.API_INPI_USERNAME }}
@@ -61,37 +72,49 @@ jobs:
6172 git config --global user.email [email protected] 6273 git config --global user.name "Quarto GHA Workflow Runner"
6374 quarto publish gh-pages . --no-render --no-browser
75+
6476 enonces :
6577 name : Render notebooks
6678 runs-on : ubuntu-latest
6779 if : ${{ !github.event.pull_request.head.repo.fork }}
6880 steps :
81+
6982 - uses : actions/checkout@v4
7083 with :
7184 fetch-depth : 0
7285 ref : ${{ github.event.pull_request.head.ref }}
7386 repository : ${{github.event.pull_request.head.repo.full_name}}
87+
7488 - name : Configure safe.directory # Workaround for actions/checkout#760
7589 run : git config --global --add safe.directory /__w/python-datascientist/python-datascientist
90+
7691 - name : Install system dependencies
7792 run : |
7893 sudo ./build/requirements.sh
79- - name : Install the latest version of uv and set the python version to 3.13t
94+
95+ - name : Install the latest version of uv
8096 uses : astral-sh/setup-uv@v6
8197 with :
82- python-version : " 3.12"
83- enable-cache : true
84- cache-dependency-glob : " uv.lock"
85- - uses : quarto-dev/quarto-actions/setup@v2
86- - run : |
87- quarto --version
98+ version : " latest"
99+ python-version : 3.12
100+
101+ - name : Restore environment
102+ run : uv sync
103+
104+ # Step 3: Set up Quarto
105+ - name : Set up quarto
106+ uses : quarto-dev/quarto-actions/setup@v2
107+
108+ - name : Install SpaCy corpus and check quarto version
109+ run : |
110+ uv run spacy download en_core_web_sm
111+ uv run quarto --version
112+
88113 - name : Prepare directory
89114 run : |
90115 rm _quarto.yml
91116 cp _quarto-prod.yml _quarto.yml
92- - name : Install Python dependencies
93- run : |
94- uv sync
117+
95118 - name : Convert in ipynb with Quarto
96119 env :
97120 API_INPI_USERNAME : ${{ secrets.API_INPI_USERNAME }}
@@ -133,73 +156,4 @@ jobs:
133156 # target-branch: test
134157 create-target-branch-if-needed : true
135158 reset-repo : true
136- enonces-vscode :
137- name : Render notebooks (VSCode version)
138- runs-on : ubuntu-latest
139- if : ${{ !github.event.pull_request.head.repo.fork }}
140- steps :
141- - uses : actions/checkout@v4
142- with :
143- fetch-depth : 0
144- ref : ${{ github.event.pull_request.head.ref }}
145- repository : ${{github.event.pull_request.head.repo.full_name}}
146- - name : Configure safe.directory # Workaround for actions/checkout#760
147- run : |
148- git config --global --add safe.directory /__w/python-datascientist/python-datascientist
149- git config --global --add safe.directory /__w/python-datascientist/python-datascientist-notebooks-vscode
150- - name : Install system dependencies
151- run : |
152- sudo ./build/requirements.sh
153- - name : Install the latest version of uv and set the python version to 3.13t
154- uses : astral-sh/setup-uv@v6
155- with :
156- python-version : " 3.12"
157- enable-cache : true
158- cache-dependency-glob : " uv.lock"
159- - uses : quarto-dev/quarto-actions/setup@v2
160- - run : |
161- quarto --version
162- - name : Prepare directory
163- run : |
164- rm _quarto.yml
165- cp _quarto-prod.yml _quarto.yml
166- - name : Install Python dependencies
167- run : |
168- uv sync
169- - name : Convert in ipynb with Quarto
170- env :
171- API_INPI_USERNAME : ${{ secrets.API_INPI_USERNAME }}
172- API_INPI_PASSWORD : ${{ secrets.API_INPI_PASSWORD }}
173- run : |
174- export QUARTO_PROFILE=fr,en
175- cp _quarto.yml _quarto-prod.yml
176- uv run ./build/nice-vscode/tweak_pipeline_vscode.py --filename _quarto-prod.yml
177- cp _quarto-prod2.yml _quarto.yml
178- rm content/modelisation/index.qmd # Remove file not building in ipynb
179- uv run quarto render --profile fr --to ipynb
180- uv run quarto render --profile en --to ipynb
181- - name : Move to expected directory
182- env :
183- API_INPI_USERNAME : ${{ secrets.API_INPI_USERNAME }}
184- API_INPI_PASSWORD : ${{ secrets.API_INPI_PASSWORD }}
185- run : |
186- mkdir -p temp_notebooks
187- mkdir -p temp_notebooks/notebooks
188- uv run build/move_files.py --direction temp_notebooks/notebooks
189- uv run quarto render content --to ipynb --execute -M echo:true
190- mkdir -p temp_notebooks/corrections
191- uv run build/move_files.py --direction temp_notebooks/corrections
192- - name : Pushes to another repository
193- uses : linogaliana/github-action-push-to-another-repository@main
194- env :
195- API_TOKEN_GITHUB : ${{ secrets.API_TOKEN_GITHUB }}
196- with :
197- source-directory : ' temp_notebooks/'
198- destination-repository-username : ' linogaliana'
199- destination-repository-name : ' python-datascientist-notebooks-vscode'
200- 201- destination-github-username : linogaliana
202- # target-branch: test
203- create-target-branch-if-needed : true
204- reset-repo : true
205159
0 commit comments