This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: add binder links & deploy mkdocs | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
mkdocs_and_binder_link: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: add_link | |
uses: fortierq/add-binder-link-action@latest | |
with: | |
env: 'mp2i-info/mp2i-binder' | |
branch-env: 'main' | |
server: 'basthon' | |
force: false | |
- name: mkdocs | |
run: | | |
pip install pygments==2.11 mkdocs-material | |
TMP_DIR=$(mktemp -d) | |
DIR=$(pwd) | |
git clone "https://fortierq:${{ secrets.API_TOKEN_GITHUB }}@github.com/fortierq/mkdocs-jupyter.git" "$TMP_DIR/mkdocs-jupyter" | |
cd $TMP_DIR/mkdocs-jupyter/js | |
npm install && npm run build | |
cd ../.. | |
pip install ./mkdocs-jupyter/ | |
cd $DIR | |
for file in $(find . -type f -name "*.pdf"); do | |
fit=Fit | |
name=$(basename $file) | |
if [[ $name == td* ]] || [[ $name == TD* ]] || [[ $name == tp* ]] || [[ $name == TP* ]] || [[ $name == ds* ]]; | |
then | |
fit=FitW | |
fi | |
echo "<iframe src=../${name}#view=$fit&navpanes=0&statusbar=0 height=700 width=100%></iframe>" > ${file%.*}.md | |
done | |
mkdocs gh-deploy --force |