Skip to content

Commit

Permalink
complete basic setup
Browse files Browse the repository at this point in the history
  • Loading branch information
IamShubhamGupto committed Nov 21, 2023
1 parent 9a59aad commit 45c6fe1
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 48 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: build-and-deploy-book

# Trigger the workflow on push to main branch and PRs
on: [push, pull_request]
# This job installs dependencies, builds the book, and deploys the html
jobs:
build-and-deploy-book:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Get PR number
run: echo "Your PR is ${PR}"
env:
PR: ${{ github.event.pull_request.number }}
- name: 📦 Cache Conda Packages
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda-linux-64.lock') }}
- name: 🐍 Set up Conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
activate-environment: DGM2lines
environment-file: conda-linux-64.lock
- name: 👀 Check Conda environment
shell: bash -l {0}
run: |
conda info
conda list
- name: 📦 Cache Notebooks
uses: actions/cache@v2
with:
path: _build/.jupyter_cache
key: notebook_cache-${{hashFiles('_toc.yml', '_config.yml', 'environment.yml') }}
- name: 📖 Build the book
shell: bash -l {0}
run: |
mkdir -p _notebook_cache
jupyter-book build .
- name: 📖 Show logs from the book build
shell: bash -l {0}
run: |
find _build/html -name "*.log" -print -exec cat {} \;
- name: 🚀 Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
keep_files: false
force_orphan: true
57 changes: 57 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

# this title does not seem to work, refer to sphinx.config.html_theme_options.logo.text
title: Data Gallery
author: The M<sup>2</sup>LInES Community
logo: assets/newlogo.png

exclude_patterns: ['env/*', '_build/*']
only_build_toc_files: true
# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
execute:
execute_notebooks: force
timeout: 1800
exclude_patterns: ['*old_notebooks/*']

parse:
myst_enable_extensions:
- amsmath
- dollarmath

# Define the name of the latex output file for PDF builds
latex:
latex_documents:
targetname: book.tex

# Add a bibtex file so that we can create citations
bibtex_bibfiles:
- references.bib

# set to author_year format
sphinx:
html4_writer:
{
"citation_show_urls": False,
"citation_references": "full",
"external_links": False,
}
config:
bibtex_reference_style: author_year
nb_merge_streams: true
html_theme_options:
# title of the notebook
logo:
text: "Data Gallery"

# Information about where the book exists on the web
repository:
url: https://github.com/m2lines/data-gallery # Online location of your book
branch: main # Which branch of the repository should be used when creating links (optional)

# Add GitHub buttons to your book
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
html:
use_issues_button: true
use_repository_button: true
9 changes: 9 additions & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Table of contents
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro
parts:
- caption: Basic Concepts
chapters:
- file: notebooks/xarray_intro.ipynb
Binary file added assets/newlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Introduction

: 🚧 Under Development 🚧

Check back soon!
96 changes: 48 additions & 48 deletions notebooks/xarray_intro.ipynb

Large diffs are not rendered by default.

Empty file added references.bib
Empty file.

0 comments on commit 45c6fe1

Please sign in to comment.