Skip to content

Instantly share code, notes, and snippets.

@walice
Created August 12, 2025 21:41
Show Gist options
  • Select an option

  • Save walice/946b036a92701bace2d92b6364b60f4e to your computer and use it in GitHub Desktop.

Select an option

Save walice/946b036a92701bace2d92b6364b60f4e to your computer and use it in GitHub Desktop.
GitHub deployment section of a Jupyter notebook that is converted into a self-updating webpage. Full tutorial available at: https://alicelepissier.com/programming/automated-notebook.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"# Create daily commit message\n",
"now = datetime.datetime.now()\n",
"commit_message = \"Last scraped on \" + str(now)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Deploy to GitHub\n",
"! git add .\n",
"! echo $commit_message > commit_message.txt\n",
"! git commit -F commit_message.txt\n",
"! git push"
]
}
],
"metadata": {},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment