Unable to create simple gh pages output with nbdev hello world

Hi All,

I’ve tried the following process to create a simple GH pages output, following nbdev - End-To-End Walkthrough

mamba install -c fastai nbdev

On github

  • Create PAT token (all repo permissions on nbdev-hello-world repo)
  • goto Sign in to GitHub · GitHub
  • Create repo nbdev-hello-world, add desc, click ‘Create repository’
  • clone repo with ssh
  • export GITHUB_TOKEN=github_pat_…
  • Run nbdev_new
  • Run
git add .
git commit -m'Initial commit'
git push

on github.com on repo page … settings → pages → build from main branch

  • Goto repo → actions and see the following outputs

CI : Initial commit #1
Notebooks and library are not in sync. Please run nbdev_export.
Process completed with exit code 1.

Deploy to GitHub Pages : Initial commit #1
Action failed with “The process ‘/usr/bin/git’ failed with exit code 128”

Although success for pages build and deployment #1

but on nbdev-hello-world | nbdev-hello-world I cannot see the nav etc so I think it’s not working due to the above errors.

is anyone able to tell me where in the process I’m making errors?


I decided to try out nbdev today, and am getting a similar error as you are. Can’t seem to find much online.

I also get this warning when running nbdev_new:

/Users/[REDACTED]/lib/python3.10/site-packages/ghapi/core.py:101: UserWarning: Neither GITHUB_TOKEN nor GITHUB_JWT_TOKEN found: running as unauthenticated else: warn('Neither GITHUB_TOKEN nor GITHUB_JWT_TOKEN found: running as unauthenticated')

yeah … Even If I create a PAT token following Creating a personal access token - GitHub Docs and then GITHUB_TOKEN=.... nbdev_new
This error disappears but then I still get the errors I put in the description when it runs the actions on github to create the pages .

Do you see this too ?

I already had a PAT in use in terminal, and I still got that user warning. I tried explicitly stating my PAT like you suggested, GITHUB_TOKEN=[PAT] nbdev_new, and it did fix the user warning. But still got the same previous errors in the workflow runs.

I’ll try asking in the fastai discord.

Did you run the following commands and try again? Run nbdev_prepare before pushing to git
You should also install the hook nbdev_install_hooks

@rosherd I am seeing the same deploy error when following the end-to-end tutorial.

The error log indicates that github-actions cannot create the gh-pages branch.

Changing the default workflow permissions (Settings → Actions → General → Workflow Permissions) to “Read and write” allowed the workflow to succeed:

It looks like this has already been filed as a nbdev bug: [Extra End-To-End Walkthrough Info Needed] Workflows need read and write permissions for pages to work · Issue #1270 · fastai/nbdev · GitHub


Did you create the branch gh-pages?
I was also struggling when creating my blog, so I summarized what I did in this blog post.
I hope this is useful for creating your blog!

1 Like

@hamelsmu updated the docs yesterday to walk through doing the GH Pages bit manually, since github as updated settings so it’s hard to automate it now.

1 Like


The problem of Actions permission is mentioned in the migrating page now. Shouldn’t this step be in the main section? Otherwise, one would miss this permission change and git push would fail at deployment.

1 Like