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

Closed

Description

@gabbydgab

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.

Activity

  1. 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[/+] on Dec 29, 2016
  2. 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[/+] on Dec 29, 2016
  3. hansl commented on Dec 30, 2016

    @hansl
    Contributor

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

  4. gabbydgab commented on Dec 30, 2016

    @gabbydgab
    Author

    @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.

  5. filipesilva commented on Feb 3, 2017

    @filipesilva
    Contributor

    Closed via #4385.

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

  6. HeinPauwelyn commented on Mar 18, 2017

    @HeinPauwelyn

    @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

  7. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs: investigationRequires some digging to determine if action is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions