Merge pull request #133 from ludopulles/main #192
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: Publish Jupyter Notebooks | |
on: | |
push: | |
branches: [ main, docs ] | |
jobs: | |
deploy: | |
name: Publish | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Install Prerequists | |
run: | | |
python -m pip install --upgrade --break-system-packages pip | |
pip install --break-system-packages sphinxcontrib-jupyter | |
- name: Generate Jupyter Notebooks | |
run: | | |
make jupyter | |
- name: Copy over | |
run: | | |
mkdir out | |
cp pyproject.toml out/ | |
cp -r .github/ out/ | |
cp -r estimator/ out/ | |
rm -rf out/estimator/__pycache__ | |
echo 'name: lattice-estimator-environment' >> out/environment.yml | |
echo 'channels:' >> out/environment.yml | |
echo ' - conda-forge' >> out/environment.yml | |
echo 'dependencies:' >> out/environment.yml | |
echo ' - python' >> out/environment.yml | |
echo ' - pip' >> out/environment.yml | |
echo ' - sage' >> out/environment.yml | |
echo ' - pip:' >> out/environment.yml | |
echo ' - nbgitpuller' >> out/environment.yml | |
echo ' - sphinx-gallery' >> out/environment.yml | |
echo ' - pandas' >> out/environment.yml | |
echo ' - matplotlib' >> out/environment.yml | |
cp docs/_build/jupyter/algorithms/*.ipynb out | |
cp docs/_build/jupyter/prompt.ipynb out | |
- name: Publish | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: jupyter-notebooks | |
FOLDER: out | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |