@@ -11,48 +11,40 @@ jobs:
11
11
blogdown :
12
12
name : Render-Blog
13
13
runs-on : ubuntu-latest
14
- container : linogaliana/python-datascientist:latest
14
+ container : linogaliana/python-datascientist-vstudio:quarto
15
15
steps :
16
16
- uses : actions/checkout@v2
17
17
with :
18
18
submodules : true
19
19
fetch-depth : 0
20
20
ref : ${{ github.event.pull_request.head.ref }}
21
21
repository : ${{github.event.pull_request.head.repo.full_name}}
22
- - name : Install rmarkdown
23
- env :
24
- GITHUB_PAT : ${{ secrets.PAT_GITHUB }}
25
- run : |
26
- Rscript -e 'remotes::install_github("yihui/xfun")'
27
- Rscript -e 'remotes::install_github("yihui/knitr")'
28
- Rscript -e 'install.packages(c("rmarkdown", "here"))'
29
- - name : install hugo
30
- run : Rscript -e 'blogdown::install_hugo("0.83.0", force = TRUE)'
31
- - name : Install Python
32
- run : |
33
- Rscript -e 'print(blogdown:::hugo_version())'
34
- Rscript -e "install.packages(c('remotes', 'reticulate'))"
35
- Rscript -e "install.packages(c('here'))"
36
- - shell : bash -l {0}
22
+ - name : Configure safe.directory # Workaround for actions/checkout#760
23
+ run : git config --global --add safe.directory /__w/python-datascientist/python-datascientist
24
+ - shell : bash
37
25
run : |
38
26
conda info
39
27
conda list
40
28
- name : Build to md
41
29
run : |
42
- git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff.txt
43
- cat diff.txt
44
- Rscript -e 'source("./build/build_light.R")'
30
+ quarto render --to hugo
31
+ mv content/course/manipulation/index.md content/course/manipulation/_index.md
32
+ mv content/course/visualisation/index.md content/course/visualisation/_index.md
33
+ 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")'
37
+ hugo mod graph
38
+ hugo -D --themesDir themes -t github.com
45
39
- name : Clean files with Python function
46
40
run : |
47
- rm -rf "./temp"
48
- mkdir -p temp
49
- mkdir -p notebooks
50
41
pip install matplotlib wordcloud nltk
51
- python build/cleanmd.py
52
42
python build/wc_website.py
53
- - name : Render blog
43
+ python build/post-build.py
44
+ - name : Copy notebooks in dedicated directory
54
45
run : |
55
- Rscript -e 'source("./build/netlify.R")'
46
+ mkdir -p notebooks
47
+ python build/move_files.py notebooks
56
48
- name : Install npm
57
49
if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
58
50
uses : actions/setup-node@v2
@@ -74,28 +66,10 @@ jobs:
74
66
with :
75
67
name : Website
76
68
path : public/
77
- - name : Convert in ipynb with Jupytext
78
- run : |
79
- pip install jupytext
80
- cd ./temp
81
- for i in $(find . -type f \( -iname "*.Rmd" \)); do \
82
- j="${i%.Rmd}.md" ;
83
- echo "$j" ;
84
- if [ -e $j ]
85
- then
86
- echo "Converting $j"; \
87
- #jupytext --to py --execute "$i"
88
- jupytext --to ipynb "$j" ;
89
- k="${j%.md}.ipynb" ;
90
- fi
91
- done
92
- mkdir -p ../notebooks
93
- cp -R . ../notebooks
94
- cd ..
95
69
- uses : actions/upload-artifact@v2
96
70
with :
97
71
name : Notebooks
98
- path : temp /
72
+ path : notebooks /
99
73
- name : Commit new notebooks
100
74
if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
101
75
env :
@@ -106,67 +80,32 @@ jobs:
106
80
# git config user.email github-actions@github.com
107
81
#git checkout ${BRANCHE_REF}
108
82
git status
109
- git add notebooks/**/* .ipynb;
83
+ find notebooks -type f -name "* .ipynb" | xargs git add
110
84
git commit -m "Automated changes";
111
85
git pull
112
86
git push
113
87
corrections :
88
+ name : Render-Blog
114
89
runs-on : ubuntu-latest
115
- container : linogaliana/python-datascientist:latest
90
+ container : linogaliana/python-datascientist-vstudio:quarto
116
91
steps :
117
92
- uses : actions/checkout@v2
118
93
with :
119
94
submodules : true
120
95
fetch-depth : 0
121
96
ref : ${{ github.event.pull_request.head.ref }}
122
97
repository : ${{github.event.pull_request.head.repo.full_name}}
123
- - name : Install rmarkdown
124
- env :
125
- GITHUB_PAT : ${{ secrets.PAT_GITHUB }}
126
- run : |
127
- Rscript -e 'remotes::install_github("yihui/xfun")'
128
- Rscript -e 'remotes::install_github("yihui/knitr")'
129
- Rscript -e 'install.packages(c("rmarkdown"))'
130
- - name : Install Python
131
- run : |
132
- Rscript -e "install.packages(c('remotes', 'reticulate'))"
133
- Rscript -e "install.packages(c('here'))"
134
- - shell : bash -l {0}
98
+ - name : Configure safe.directory # Workaround for actions/checkout#760
99
+ run : git config --global --add safe.directory /__w/python-datascientist/python-datascientist
100
+ - shell : bash
135
101
run : |
136
102
conda info
137
103
conda list
138
- - name : Modif Rmd echo status
139
- run : |
140
- python build/modifmd.py
141
- - name : Build to md
142
- run : |
143
- git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff.txt
144
- cat diff.txt
145
- Rscript -e 'source("./build/build_light.R")'
146
- - name : Clean files with Python function
147
- run : |
148
- rm -rf "./temp"
149
- mkdir -p temp
150
- mkdir -p corrections
151
- python build/cleanmd.py
152
104
- name : Convert in ipynb with Jupytext
153
105
run : |
154
- pip install jupytext
155
- cd ./temp
156
- for i in $(find . -type f \( -iname "*.Rmd" \)); do \
157
- j="${i%.Rmd}.md" ;
158
- echo "$j" ;
159
- if [ -e $j ]
160
- then
161
- echo "Converting $j"; \
162
- #jupytext --to py --execute "$i"
163
- jupytext --to ipynb "$j" ;
164
- k="${j%.md}.ipynb" ;
165
- fi
166
- done
167
- mkdir -p ../corrections
168
- cp -R . ../corrections
169
- cd ..
106
+ quarto render content --to ipynb --execute
107
+ mkdir -p corrections
108
+ python build/move_files.py corrections
170
109
- uses : actions/upload-artifact@v2
171
110
with :
172
111
name : Corrections
@@ -181,8 +120,87 @@ jobs:
181
120
# git config user.email github-actions@github.com
182
121
#git checkout ${BRANCHE_REF}
183
122
git status
184
- git add corrections/**/* .ipynb;
123
+ find corrections -type f -name "* .ipynb" | xargs git add
185
124
git commit -m "Automated changes";
186
125
git pull
187
126
git push
188
127
128
+
129
+
130
+
131
+ # corrections:
132
+ # runs-on: ubuntu-latest
133
+ # container: linogaliana/python-datascientist:latest
134
+ # steps:
135
+ # - uses: actions/checkout@v2
136
+ # with:
137
+ # submodules: true
138
+ # fetch-depth: 0
139
+ # ref: ${{ github.event.pull_request.head.ref }}
140
+ # repository: ${{github.event.pull_request.head.repo.full_name}}
141
+ # - name: Install rmarkdown
142
+ # env:
143
+ # GITHUB_PAT: ${{ secrets.PAT_GITHUB }}
144
+ # run: |
145
+ # Rscript -e 'remotes::install_github("yihui/xfun")'
146
+ # Rscript -e 'remotes::install_github("yihui/knitr")'
147
+ # Rscript -e 'install.packages(c("rmarkdown"))'
148
+ # - name: Install Python
149
+ # run: |
150
+ # Rscript -e "install.packages(c('remotes', 'reticulate'))"
151
+ # Rscript -e "install.packages(c('here'))"
152
+ # - shell: bash -l {0}
153
+ # run: |
154
+ # conda info
155
+ # conda list
156
+ # - name: Modif Rmd echo status
157
+ # run: |
158
+ # python build/modifmd.py
159
+ # - name: Build to md
160
+ # run: |
161
+ # git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff.txt
162
+ # cat diff.txt
163
+ # Rscript -e 'source("./build/build_light.R")'
164
+ # - name: Clean files with Python function
165
+ # run: |
166
+ # rm -rf "./temp"
167
+ # mkdir -p temp
168
+ # mkdir -p corrections
169
+ # python build/cleanmd.py
170
+ # - name: Convert in ipynb with Jupytext
171
+ # run: |
172
+ # pip install jupytext
173
+ # cd ./temp
174
+ # for i in $(find . -type f \( -iname "*.Rmd" \)); do \
175
+ # j="${i%.Rmd}.md" ;
176
+ # echo "$j" ;
177
+ # if [ -e $j ]
178
+ # then
179
+ # echo "Converting $j"; \
180
+ # #jupytext --to py --execute "$i"
181
+ # jupytext --to ipynb "$j" ;
182
+ # k="${j%.md}.ipynb" ;
183
+ # fi
184
+ # done
185
+ # mkdir -p ../corrections
186
+ # cp -R . ../corrections
187
+ # cd ..
188
+ # - uses: actions/upload-artifact@v2
189
+ # with:
190
+ # name: Corrections
191
+ # path: corrections/
192
+ # - name: Commit new notebooks
193
+ # if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
194
+ # env:
195
+ # BRANCHE_REF: ${{ github.event.pull_request.head.ref }}
196
+ # run: |
197
+ # git config user.name 'github-actions[bot]'
198
+ # git config user.email 'github-actions[bot]@users.noreply.github.com'
199
+ # # git config user.email github-actions@github.com
200
+ # #git checkout ${BRANCHE_REF}
201
+ # git status
202
+ # git add corrections/**/*.ipynb;
203
+ # git commit -m "Automated changes";
204
+ # git pull
205
+ # git push
206
+
0 commit comments