How can I deploy websites to a subfolder (e.g. in /docs/
) using Github Pages
#1857
-
I am working on a repository for creating differentiable loss functions: I have a The documentation here says to run the following command in the root: But when I run the I first run Would also like to automatically generate documentation for the functions and classes defined in |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You can add a deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install MyST Markdown
run: npm install -g mystmd
- name: Build HTML Assets
run: myst build --html
working-directory: docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs/_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 |
Beta Was this translation helpful? Give feedback.
-
@rowanc1 Thanks, I did this exact same thing yesterday through trial and error and it worked! One question remains though, how do I create API documentation using the docstrings in my classes and functions? |
Beta Was this translation helpful? Give feedback.
-
Glad it is working! Yes, a follow on issue would be helpful to track that. There is some investigation going into this at the moment, but currently no out of the box solution for auto-generated API docs. |
Beta Was this translation helpful? Give feedback.
You can add a
working-directory: docs
to eachstep
in thedeploy
action as well as ensuring that the./docs/_build/html
is what is uploaded. Something like (untested, let us know what works here please!):