Host github pages from the / dist folder in the main branch

I tried to publish my-username-.imtqy.com repository for github pages, but mine index.htmlis inside the folder dist.

I cannot use git subtree push --prefix dist origin gh-pagesit because it is intended for project pages, not for user pages / org.

All I want is github to handle dist as the root directory to host the / org user page. Please, help. thank

PS: I do not want to do a redirect.

+7
source share
2 answers

You cannot do it this way.

GitHub pages can be hosted with:

  • /
  • / gh-pages
  • /docs

/ .

, . CI/CD .

+3

GitHub ( )

, gh-, /docs , , , .gitignore

ggDJH.png

npm, , gh-. --save-dev devDependencies:

  • # install
    $ npm install push-dir --save-dev
    
    # usage
    $ push-dir --dir=dist --branch=gh-pages
    
  • GH-

    # install
    $ npm install gh-pages --save-dev
    
    # usage
    $ gh-pages -d dist
    

, , , , package.json :

"scripts": {
  "deploy": "npm run build && gh-pages -d dist"
}

:

+3

Source: https://habr.com/ru/post/1670872/


All Articles