@@ -13,32 +13,43 @@ jobs:
13
13
runs-on : ubuntu-latest
14
14
if : ${{ !github.event.pull_request.head.repo.fork }}
15
15
steps :
16
+
16
17
- uses : actions/checkout@v4
17
18
with :
18
19
fetch-depth : 0
19
20
ref : ${{ github.event.pull_request.head.ref }}
20
21
repository : ${{github.event.pull_request.head.repo.full_name}}
22
+
21
23
- name : Configure safe.directory # Workaround for actions/checkout#760
22
24
run : git config --global --add safe.directory /__w/python-datascientist/python-datascientist
25
+
23
26
- name : Install system dependencies
24
27
run : |
25
28
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
27
31
uses : astral-sh/setup-uv@v6
28
32
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
+
35
48
- name : Prepare directory
36
49
run : |
37
50
rm _quarto.yml
38
51
cp _quarto-prod.yml _quarto.yml
39
- - name : Install Python dependencies
40
- run : |
41
- uv sync
52
+
42
53
- name : Render website
43
54
env :
44
55
API_INPI_USERNAME : ${{ secrets.API_INPI_USERNAME }}
@@ -61,37 +72,49 @@ jobs:
61
72
git config --global user.email quarto-github-actions-publish@example.com
62
73
git config --global user.name "Quarto GHA Workflow Runner"
63
74
quarto publish gh-pages . --no-render --no-browser
75
+
64
76
enonces :
65
77
name : Render notebooks
66
78
runs-on : ubuntu-latest
67
79
if : ${{ !github.event.pull_request.head.repo.fork }}
68
80
steps :
81
+
69
82
- uses : actions/checkout@v4
70
83
with :
71
84
fetch-depth : 0
72
85
ref : ${{ github.event.pull_request.head.ref }}
73
86
repository : ${{github.event.pull_request.head.repo.full_name}}
87
+
74
88
- name : Configure safe.directory # Workaround for actions/checkout#760
75
89
run : git config --global --add safe.directory /__w/python-datascientist/python-datascientist
90
+
76
91
- name : Install system dependencies
77
92
run : |
78
93
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
80
96
uses : astral-sh/setup-uv@v6
81
97
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
+
88
113
- name : Prepare directory
89
114
run : |
90
115
rm _quarto.yml
91
116
cp _quarto-prod.yml _quarto.yml
92
- - name : Install Python dependencies
93
- run : |
94
- uv sync
117
+
95
118
- name : Convert in ipynb with Quarto
96
119
env :
97
120
API_INPI_USERNAME : ${{ secrets.API_INPI_USERNAME }}
@@ -133,73 +156,4 @@ jobs:
133
156
# target-branch: test
134
157
create-target-branch-if-needed : true
135
158
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
- user-email : lino.galiana@insee.fr
201
- destination-github-username : linogaliana
202
- # target-branch: test
203
- create-target-branch-if-needed : true
204
- reset-repo : true
205
159
0 commit comments