Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 48 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
---
on:
workflow_dispatch: null
push:
branches: main
name: Quarto Publish
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Install Python and Dependencies
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
- run: pip install jupyter
- run: pip install -r requirements.txt
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Build and Deploy

on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install the dependencies
run: |
python -m pip install -r requirements.txt
- name: Build the JupyterLite site
run: |
cp README.md content
jupyter lite build --contents content --output-dir dist
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

deploy:
needs: build
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,24 @@
- Navigate to your forked repository.
- Click on the green "Code" button and from the dropdown, select "Codespaces" and click on “Create codespace on main”.

3. **Publish with Quarto**:
- Within your Codespace terminal, enter the command:
```
quarto publish gh-pages
```
- This command instructs Quarto to compile and publish your notebook content to the `gh-pages` branch, which GitHub automatically uses to host web-accessible content.

5. **Modify the Jupyter Notebook**:
3. **Modify the Jupyter Notebook**:
- In your Codespace, locate the `hello.ipynb` Jupyter notebook and open it.
- Make some changes or additions to the notebook content. Feel free to get creative!
- Save your changes once done.

6. **Commit & Push**:
4. **Commit & Push**:
- In the source control panel of Codespaces (typically an icon that looks like a branching tree), stage your changes and commit them with a descriptive message.
- Push your committed changes to your GitHub repository.

7. **Review Your Live Notebook**:
- Once the changes are pushed, navigate to the URL associated with the `gh-pages` of your forked repository (typically in the format `https://[your-username].github.io/[repository-name]/`). You should see the updated Jupyter notebook content live!
5. **Review Your Live Notebook**:
- Once the changes are pushed, navigate to the URL associated with the `gh-pages` of your forked repository (typically in the format `https://[your-username].github.io/[repository-name]/lab`). You should see the updated Jupyter notebook content live!

### Reflection:

1. How do Codespaces enhance the experience of remote development and publishing?
2. Discuss the significance of the `gh-pages` branch in the context of GitHub.

Great work! 🌟 Leveraging Quarto and GitHub functionalities, you've just broadened your toolkit for publishing interactive content online. Dive deeper, and explore more possibilities!

# TODO:
- streamline filesystem access / access to notebooks stored online
4 changes: 2 additions & 2 deletions hello.ipynb

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
numpy
matplotlib
matplotlib
jupyterlite-core
jupyterlite-pyodide-kernel
jupyterlab-filesystem-access