diff --git a/.github/workflows/build-html-and-deploy.yml b/.github/workflows/build-html-and-deploy.yml index 7c191d8..3aede5f 100644 --- a/.github/workflows/build-html-and-deploy.yml +++ b/.github/workflows/build-html-and-deploy.yml @@ -1,42 +1,58 @@ -name: Build HTML and Deploy to GH-PAGES +name: Build & Deploy Jupyter Book + on: push: - branches: - - main + branches: [main] + workflow_dispatch: permissions: - contents: write + contents: read pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: true jobs: - build-html-and-deploy: + build: runs-on: ubuntu-latest steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2 - with: - persist-credentials: false + - uses: actions/checkout@v4 - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/setup-python@v5 with: - auto-update-conda: true - auto-activate-base: false - miniconda-version: 'latest' - python-version: 3.9 - environment-file: environment.yml - activate-environment: cal-icor-docs - - - name: Build Cal ICOR docs - shell: bash -l {0} - run: jupyter-book build . - - - name: Copy CNAME Copy into final HTML output folder - run: cp CNAME ./_build/html/CNAME - - - name: Deploy 🚀 - # Push the book's HTML to github-pages - uses: peaceiris/actions-gh-pages@v3.6.1 + python-version: '3.12' + + - name: Install dependencies + run: | + pip install -r requirements.txt + + - name: Build the book + timeout-minutes: 15 + run: | + set -e + jupyter book build --html + + - name: Copy CNAME into build output + if: ${{ hashFiles('CNAME') != '' }} + run: cp CNAME _build/html/CNAME + + - name: Configure Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html + path: ./_build/html + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/test-build-pr.yml b/.github/workflows/test-build-pr.yml new file mode 100644 index 0000000..2c1e835 --- /dev/null +++ b/.github/workflows/test-build-pr.yml @@ -0,0 +1,47 @@ +name: Test Build (branches/PRs) + +on: + push: + branches: ["**"] + pull_request: + branches: ["**"] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install deps + run: | + pip install -r requirements.txt + + - name: Build the book + run: | + set -e + jupyter book build --html + + - name: Determine build output path + id: build_path + run: | + if [ -d "_build/html" ]; then + echo "path=./_build/html" >> $GITHUB_OUTPUT + elif [ -d "_build/site" ]; then + echo "path=./_build/site" >> $GITHUB_OUTPUT + else + echo "ERROR: No build output found" && exit 1 + fi + + - name: Upload artifact (for inspection) + uses: actions/upload-pages-artifact@v3 + with: + path: ${{ steps.build_path.outputs.path }} + retention-days: 1 + diff --git a/_config.yml b/_config.yml.txt similarity index 100% rename from _config.yml rename to _config.yml.txt diff --git a/_toc.yml b/_toc.yml.txt similarity index 100% rename from _toc.yml rename to _toc.yml.txt diff --git a/content/admin/calendar_scaler.md b/admin/calendar_scaler.md similarity index 100% rename from content/admin/calendar_scaler.md rename to admin/calendar_scaler.md diff --git a/content/admin/cilogon.png b/admin/cilogon.png similarity index 100% rename from content/admin/cilogon.png rename to admin/cilogon.png diff --git a/content/admin/index.md b/admin/index.md similarity index 58% rename from content/admin/index.md rename to admin/index.md index ba3aeea..402f55b 100644 --- a/content/admin/index.md +++ b/admin/index.md @@ -8,11 +8,10 @@ These documents are heavily based on the [UC Berkeley Datahub documentation](https://docs.datahub.berkeley.edu/), which is the inspiration for the CAL-ICOR JupyterHub deployment. -```{toctree} -monitoring_alerting -new_hub -rebuild_hub_image -calendar_scaler -new_image -repo2docker_local -``` +- Admin topics: + - [Monitoring and alerting](monitoring_alerting) + - [Create a new hub](new_hub) + - [Rebuild hub image](rebuild_hub_image) + - [Autoscaling calendar](calendar_scaler) + - [Build a new image](new_image) + - [repo2docker locally](repo2docker_local) diff --git a/content/admin/monitoring_alerting.md b/admin/monitoring_alerting.md similarity index 100% rename from content/admin/monitoring_alerting.md rename to admin/monitoring_alerting.md diff --git a/content/admin/new_hub.md b/admin/new_hub.md similarity index 100% rename from content/admin/new_hub.md rename to admin/new_hub.md diff --git a/content/admin/new_image.md b/admin/new_image.md similarity index 100% rename from content/admin/new_image.md rename to admin/new_image.md diff --git a/content/admin/rebuild_hub_image.md b/admin/rebuild_hub_image.md similarity index 100% rename from content/admin/rebuild_hub_image.md rename to admin/rebuild_hub_image.md diff --git a/content/admin/repo2docker_local.md b/admin/repo2docker_local.md similarity index 100% rename from content/admin/repo2docker_local.md rename to admin/repo2docker_local.md diff --git a/assets/favicon.ico b/assets/favicon.ico new file mode 100644 index 0000000..42202a7 Binary files /dev/null and b/assets/favicon.ico differ diff --git a/content/authentication.md b/authentication.md similarity index 100% rename from content/authentication.md rename to authentication.md diff --git a/content/course_creation_workflow.md b/course_creation_workflow.md similarity index 100% rename from content/course_creation_workflow.md rename to course_creation_workflow.md diff --git a/environment.yml b/environment.yml index c388857..b19ea09 100644 --- a/environment.yml +++ b/environment.yml @@ -3,9 +3,10 @@ channels: - default dependencies: - python=3.9 - - sphinx - pip - pandas - matplotlib - pip: - - jupyter-book==1.0.4 + - jupyter-book==2.0.2 + - mystmd + - ghp-import==2.1.0 diff --git a/content/faq.md b/faq.md similarity index 100% rename from content/faq.md rename to faq.md diff --git a/content/getting_started.md b/getting_started.md similarity index 100% rename from content/getting_started.md rename to getting_started.md diff --git a/content/hub_orientation.md b/hub_orientation.md similarity index 100% rename from content/hub_orientation.md rename to hub_orientation.md diff --git a/content/index.md b/index.md similarity index 96% rename from content/index.md rename to index.md index f0cc5ec..e4ed570 100644 --- a/content/index.md +++ b/index.md @@ -13,12 +13,13 @@ This documentation is a living resource covering the following topics: - **[What is the Hub?](hub_orientation)** - **[Getting Started](getting_started)** -- **[Authentication](authentication)** - **[Course Creation Workflow](course_creation_workflow)** +- **[Authentication](authentication)** - **[User Environments](user_environments)** - **[Notebook and Material Sharing](notebooks_materials)** - **[Acceptable Use and Privacy Policies](policy/index)** - **[Support Resources](support_resources)** +- **[Frequently Asked Questions](faq)** For administrators, we provide additional resources: diff --git a/myst.yml b/myst.yml new file mode 100644 index 0000000..bf07c76 --- /dev/null +++ b/myst.yml @@ -0,0 +1,46 @@ +version: 1 + +project: + title: Cal-ICOR Documentation + description: Documentation for all things ICOR + authors: + - name: Cal-ICOR team + github: cal-icor/docs + execute: + execute_notebooks: cache + + toc: + - file: index.md + - file: hub_orientation.md + - file: getting_started.md + - file: course_creation_workflow.md + - file: authentication.md + - file: user_environments.md + - file: notebooks_materials.md + - title: Policy + file: policy/index.md + children: + - file: policy/acceptable_use.md + - file: policy/privacy.md + - file: support_resources.md + - file: faq.md + - title: Admin + file: admin/index.md + children: + - file: admin/new_hub.md + - file: admin/new_image.md + - file: admin/rebuild_hub_image.md + - file: admin/repo2docker_local.md + - file: admin/monitoring_alerting.md + - file: admin/calendar_scaler.md + +site: + template: book-theme + options: + logo: assets/logo-trans.png + logo_text: Cal-ICOR Documentation + home_page_in_navbar: false + use_repository_button: true + use_issues_button: true + favicon: assets/favicon.ico + diff --git a/content/notebooks_materials.md b/notebooks_materials.md similarity index 100% rename from content/notebooks_materials.md rename to notebooks_materials.md diff --git a/content/policy/acceptable_use.md b/policy/acceptable_use.md similarity index 100% rename from content/policy/acceptable_use.md rename to policy/acceptable_use.md diff --git a/content/policy/index.md b/policy/index.md similarity index 84% rename from content/policy/index.md rename to policy/index.md index ff2fca7..0f768f0 100644 --- a/content/policy/index.md +++ b/policy/index.md @@ -8,7 +8,6 @@ engagement. These policies are important for maintaining the integrity and security of the service, as well as fostering a positive community experience. -```{toctree} -acceptable_use -privacy -``` +- Policies: + - [Acceptable Use](acceptable_use) + - [Privacy](privacy) diff --git a/content/policy/privacy.md b/policy/privacy.md similarity index 100% rename from content/policy/privacy.md rename to policy/privacy.md diff --git a/requirements.txt b/requirements.txt index dfe882d..08b051c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ -sphinx -pandas -matplotlib -quantecon -jupyter-book==1.0.4 +jupyter-book==2.0.2 +mystmd +ghp-import==2.1.0 \ No newline at end of file diff --git a/content/support_resources.md b/support_resources.md similarity index 100% rename from content/support_resources.md rename to support_resources.md diff --git a/content/user_environments.md b/user_environments.md similarity index 100% rename from content/user_environments.md rename to user_environments.md