-
Notifications
You must be signed in to change notification settings - Fork 45
221 lines (214 loc) · 7.53 KB
/
netlify-test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Deploy website to Netlify and build notebooks
on:
pull_request:
branches:
- main
- master
- dev
- quarto
jobs:
pages:
name: Render-Blog
runs-on: ubuntu-latest
container: linogaliana/python-datascientist:latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Configure safe.directory # Workaround for actions/checkout#760
run: git config --global --add safe.directory /__w/python-datascientist/python-datascientist
- shell: bash
run: |
conda info
conda list
- name: Render website
run: |
git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff
python build/tweak_render.py
quarto render --to html
python build/wc_website.py
python build/tweak_markdown.py
- name: Publish to Pages
run: |
git config --global user.email quarto-github-actions-publish@example.com
git config --global user.name "Quarto GHA Workflow Runner"
quarto publish gh-pages . --no-render --no-browser
- uses: actions/upload-artifact@v2
with:
name: Content
path: content/
- uses: actions/upload-artifact@v2
with:
name: Website
path: public/
enonces:
name: Render-Blog
runs-on: ubuntu-latest
container: linogaliana/python-datascientist:latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Configure safe.directory # Workaround for actions/checkout#760
run: git config --global --add safe.directory /__w/python-datascientist/python-datascientist
- shell: bash
run: |
conda info
conda list
- name: Convert in ipynb with Quarto
run: |
git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff
python build/tweak_project.py
python build/tweak_render.py
python build/pimp_notebook.py
quarto render content --to ipynb
mkdir -p notebooks
python build/move_files.py notebooks
- uses: actions/upload-artifact@v2
with:
name: Source enonce
path: content/
- uses: actions/upload-artifact@v2
with:
name: Enonces
path: notebooks/
- name: Commit new notebooks
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
env:
BRANCHE_REF: ${{ github.event.pull_request.head.ref }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# git config user.email github-actions@github.com
#git checkout ${BRANCHE_REF}
git status
find notebooks -type f -name "*.ipynb" | xargs git add
git commit -m "Automated changes";
git pull
git push
git push
corrections:
name: Render-Blog
runs-on: ubuntu-latest
container: linogaliana/python-datascientist:latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Configure safe.directory # Workaround for actions/checkout#760
run: git config --global --add safe.directory /__w/python-datascientist/python-datascientist
- shell: bash
run: |
conda info
conda list
- name: Convert in ipynb with Quarto
run: |
git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff
python build/tweak_project.py
python build/tweak_render.py
python build/tweak_options_quarto.py
python build/pimp_notebook.py
quarto render content --to ipynb --execute
mkdir -p corrections
python build/move_files.py corrections
- uses: actions/upload-artifact@v2
with:
name: Corrections
path: corrections/
- name: Commit new notebooks
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
env:
BRANCHE_REF: ${{ github.event.pull_request.head.ref }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
# git config user.email github-actions@github.com
#git checkout ${BRANCHE_REF}
git status
find corrections -type f -name "*.ipynb" | xargs git add
git commit -m "Automated changes";
git pull
git push
# corrections:
# runs-on: ubuntu-latest
# container: linogaliana/python-datascientist:latest
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: true
# fetch-depth: 0
# ref: ${{ github.event.pull_request.head.ref }}
# repository: ${{github.event.pull_request.head.repo.full_name}}
# - name: Install rmarkdown
# env:
# GITHUB_PAT: ${{ secrets.PAT_GITHUB }}
# run: |
# Rscript -e 'remotes::install_github("yihui/xfun")'
# Rscript -e 'remotes::install_github("yihui/knitr")'
# Rscript -e 'install.packages(c("rmarkdown"))'
# - name: Install Python
# run: |
# Rscript -e "install.packages(c('remotes', 'reticulate'))"
# Rscript -e "install.packages(c('here'))"
# - shell: bash -l {0}
# run: |
# conda info
# conda list
# - name: Modif Rmd echo status
# run: |
# python build/modifmd.py
# - name: Build to md
# run: |
# git diff --name-only origin/master origin/${GITHUB_HEAD_REF} >> diff.txt
# cat diff.txt
# Rscript -e 'source("./build/build_light.R")'
# - name: Clean files with Python function
# run: |
# rm -rf "./temp"
# mkdir -p temp
# mkdir -p corrections
# python build/cleanmd.py
# - name: Convert in ipynb with Jupytext
# run: |
# pip install jupytext
# cd ./temp
# for i in $(find . -type f \( -iname "*.Rmd" \)); do \
# j="${i%.Rmd}.md" ;
# echo "$j" ;
# if [ -e $j ]
# then
# echo "Converting $j"; \
# #jupytext --to py --execute "$i"
# jupytext --to ipynb "$j" ;
# k="${j%.md}.ipynb" ;
# fi
# done
# mkdir -p ../corrections
# cp -R . ../corrections
# cd ..
# - uses: actions/upload-artifact@v2
# with:
# name: Corrections
# path: corrections/
# - name: Commit new notebooks
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
# env:
# BRANCHE_REF: ${{ github.event.pull_request.head.ref }}
# run: |
# git config user.name 'github-actions[bot]'
# git config user.email 'github-actions[bot]@users.noreply.github.com'
# # git config user.email github-actions@github.com
# #git checkout ${BRANCHE_REF}
# git status
# git add corrections/**/*.ipynb;
# git commit -m "Automated changes";
# git pull
# git push