Closed piotrromanowski closed 8 years ago
Heya,
I think this is related to (but perhaps not fully caused by) you using a user page instead of a project page.
Basically, when you do a user page, the generated content must be in the master branch, and to be honest that case isn't well covered yet.
Can I ask you to try again with a different project name?
Meanwhile I'll work on both enabling and documenting the user page scenario.
Not sure if this is related, but I was able to successfully deploy to github pages using ng github-pages:deploy --message "Optional commit message"
After deployment, I saw a blank page with a bunch of errors in the console. I figured it was related to the base href, so I used the dynamic method outlined in the docs.
That fixed my blank page. https://emmanueltsouris.github.io/ng2-MediaBrowser/
I seem to recall that there was also an anomoly with the link and the base href when I first published to github pages. Somehow there was an extra dash in the name.
So my project ng2-MediaBrowser had ng2-media-browser in the base href (was also shown to me by the cli output). When I navigated to the url, I saw a 404. When I noticed the extra dash, I looked at my repo settings, saw that the correct page url was actually .../ng2-MediaBrowser and not .../ng2-Media-Browser
Not sure where that extra dash came from, if it was my typing or a bug in the cli. I'll run it again with a similar project name when I have a chance.
@EmmanuelTsouris Thanks for the suggestions I'll have another look! I'll also checkout your project to compare to see what I possibly did wrong
@EmmanuelTsouris I'm glad to hear the feature worked for you! Not too sure of the extra dash issue, can you tell me your results with the new project?
@piotrromanowski I put up a PR that should allow you to easily push a user/org page (instead of a project page), you can find it here: https://github.com/angular/angular-cli/pull/772
It also fixes a current bug that completely breaks the deploy process.
@filipesilva I tested it again with a new project, this time I hadn't created the github project beforehand.
I created a project ng new ng2-TestProject.
I did a commit (no remote origin set yet), and then tried to do a github-pages deploy
Now I'm having issues with the token, I created a token initially with just the public repo access, but was getting access denied messages, so tried a few different extra perms, none seemed to work.
When I did this all before with my other project, I had created the project using the same name as the folder and added it as origin before doing the github-pages deploy. Which may be why it worked, and why the base href had the dash (but my project folder didn't have a dash).
Hope this helps
@EmmanuelTsouris hm, odd that it fails with a token issue after the project is created on github... The token is solely used to create the github repo, so I wouldn't expect it to be used in any way after that.
Can you copy paste the error you got? If it's something like there are no changes, deploy aborted
that it is actually the issue my PR is meant to fix.
@filipesilva here's the error, it was a classic missing key in git:
Command failed: /bin/sh -c git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
There was a permissions error during git file operations, please close any open project files/folders and try again.
You might also need to return to the master branch manually.
I [stepped through my git config](https://help.github.com/articles/error-permission-denied-publickey/ to).
ssh-add -l
showed no identities. So my github generated identity wasn't being used. I fixed the identity/key issue, and then retried the github-pages deploy. The project published successfully as https://emmanueltsouris.github.io/ng2-test-project/
Not an issue with angular-cli, just git being flakey with using the Github Mac generated github_rsa
@EmmanuelTsouris awesome, glad to hear it now works well! I like the message on the page as well :D
Getting "Failed to create GitHub repo. Error: 401 Unauthorized" when tries to deploys angular 2 app to my organization guthub page . Asking for a token and fails with 401
ng github-pages:deploy
? Please enter GitHub token you just created (used only once to create the repo): ? and your GitHub user name: Failed to create GitHub repo. Error: 401 Unauthorized
@filipesilva Please help . Getting "Failed to create GitHub repo. Error: 401 Unauthorized" when tries to deploys angular 2 app to my organization guthub page . Asking for a token and fails with 401
ng github-pages:deploy
? Please enter GitHub token you just created (used only once to create the repo): ? and your GitHub user name: Failed to create GitHub repo. Error: 401 Unauthorized
@priyeshn sounds like a GitHub command line issue. Have you looked at https://help.github.com/articles/creating-an-access-token-for-command-line-use/
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
When you run the command
ng github-pages:deploy
and the project successfully creates a branch on your github account, you receive message that saysDeployed! Visit https://${userName}.github.io/${projectName}/
andGithub pages might take a few minutes to show the deployed site.
however the site is actually never deployed. It just creates the "gh-pages" branch on that repository.