Skip to content

How can I deploy websites to a subfolder (e.g. in /docs/) using Github Pages #1857

Answered by rowanc1
atharvaaalok asked this question in Q&A
Discussion options

You must be logged in to vote

You can add a working-directory: docs to each step in the deploy action as well as ensuring that the ./docs/_build/html is what is uploaded. Something like (untested, let us know what works here please!):

  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

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by atharvaaalok
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1849 on February 11, 2025 23:59.