Skip to content

alternative command (like github-pages:deploy-master) for github-pages:deploy that will push to master if my repository is XXX.github.io #3772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gabbydgab opened this issue Dec 28, 2016 · 5 comments
Assignees
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@gabbydgab
Copy link

gabbydgab commented Dec 28, 2016

since GH-PAGES for XXX.github.io repo should be in master branch, then ng github-pages:deploy command is irrelevant.

My short-term solution (see https://github.com/gabbydgab/gabbydgab.github.io) is to push the code in develop branch then do git subtree push --prefix dist origin master to push it on master.

My current workflow for my solution:

> ng new GitHubPage
> cd GitHubPage
> git init
> git remote add origin git@github.com:<user>/<user>.github.io.git
> ng build --prod  // assumed that you're done with your page
> git stage -A; git commit -m "initial gh-page"
> git checkout -b develop
> git push -u origin develop
> git subtree push --prefix dist origin master

With this, I would like to request for new feature that will commit code in develop branch then push gh-page to master if my repository is XXX.github.io

New workflow:

> ng new GitHubPage
> cd GitHubPage
> git init
> git remote add origin git@github.com:<user>/<user>.github.io.git
> ng build --prod  // assumed that you're done with your page
> git stage -A; git commit -m "initial gh-page"
> ng github-pages:deploy-master // or similar

So every time I'm done working with my page, then I'll just invoke ng github-pages:deploy-master to push my code with ease.

@gabbydgab gabbydgab changed the title alternative command (like ng github-pages:deploy-master) for ng github-pages:deploy that will push to master if repository is XXX.github.io alternative command (like github-pages:deploy-master) for github-pages:deploy that will push to master if repository is XXX.github.io Dec 29, 2016
@gabbydgab gabbydgab changed the title alternative command (like github-pages:deploy-master) for github-pages:deploy that will push to master if repository is XXX.github.io alternative command (like github-pages:deploy-master) for github-pages:deploy that will push to master if my repository is XXX.github.io Dec 29, 2016
@hansl
Copy link
Contributor

hansl commented Dec 30, 2016

@filipesilva I'm not sure I understand this issue, so I'll defer to you.

@hansl hansl added the needs: investigation Requires some digging to determine if action is needed label Dec 30, 2016
@gabbydgab
Copy link
Author

gabbydgab commented Dec 30, 2016

@hansl @filipesilva

User & Organization Pages live in a special repository dedicated to GitHub Pages files. You will need to name this repository with the account name.

  • You must use the username.github.io naming scheme.

Which I did, see https://github.com/gabbydgab/gabbydgab.github.io

The issues (basically inconvenience) that I encountered are the following:

  1. My profile, https://gabbydgab.github.io, will not load if I commit the application (skeleton) code base in the master branch because of the restriction in parsing the gh-page (index.html) that's why I'm manually committing it to a non-master branch like develop (also serve as my default branch).

Reason: Content from the master branch will be used to build and publish your GitHub Pages site.

You can read more about the documentation for User/Organization Page that has a repository named username.github.io

  1. I will have extra command, git subtree push --prefix dist origin master, to execute in order to publish my page.

The cli command ng github-pages:deploy is not applicable for username.github.io repository since it publishes the distributed files to gh-pages branch and not in the master.

With this issue (inconvenience), I humbly ask for a new feature to add command like ng github-pages:deploy-master that will publish the distributed files (within dist folder) to the master branch of an username.github.io repository.

@filipesilva
Copy link
Contributor

Closed via #4385.

@gabbydgab will you find an alternative package in that PR, I think it supports your usecase.

@HeinPauwelyn
Copy link

@gabbydgab I've the same issue with the command ng github-pages:deploy and Angular CLI. I'll atomize by using a batch file like below:

git status
git add *
git commit -m "deploy"
git pull
git push

ng github-pages:deploy
git checkout gh-pages 

echo "copy all your files in this folder to a temporary folder outside this repository (except these inside the `.gitignore` file)"
pause

rem must be automatic done by using this xcopy . ..\temp

git checkout master

echo "copy all your file form the temporary folder back into the repository"
pause

rem rmdir /s /q .
rem xcopy ..\temp .

git status
git add *
git commit -m "deploy"
git pull
git push

echo "site is deployed!"

git checkout development

But there is a bug in the site. See the question on Stack Overflow.

Could this ba a solution for your issue or do you know the answer of my question?

Thanks

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

4 participants