Skip to content

Publishing to gh-pages #429

@jywarren

Description

@jywarren

Hi @stephaniequintana i'm documenting my steps here. I started in my own fork, https://github.com/jywarren/infragram/, and aiming to publish the latest https://github.com/publiclab/infragram/ main branch, and i'll comment the lines below to explain as I go.

gitpod /workspace/infragram (main) $ git checkout gh-pages # start in the gh-pages branch
Updating files: 100% (24056/24056), done.
branch 'gh-pages' set up to track 'upstream/gh-pages'.
Switched to a new branch 'gh-pages'
gitpod /workspace/infragram (gh-pages) $ git merge main # merge in the main branch on top of the gh-pages branch 
Auto-merging README.md
Auto-merging index.html
CONFLICT (content): Merge conflict in index.html # OK, here 3 files conflicted, which is OK. they are small conflicts and easy to manually fix
Auto-merging package-lock.json
CONFLICT (content): Merge conflict in package-lock.json
Auto-merging package.json
CONFLICT (content): Merge conflict in package.json
Automatic merge failed; fix conflicts and then commit the result.
gitpod /workspace/infragram (gh-pages|MERGING) $ vi package.json # here i removed the older dependencies
gitpod /workspace/infragram (gh-pages|MERGING) $ vi index.html # here was just a single line difference, i confirmed which was more recent and went with that
gitpod /workspace/infragram (gh-pages|MERGING) $ npm install # here it'll generate an updated package-lock.json from our deconflicted package.json
gitpod /workspace/infragram (gh-pages|MERGING) $ git status # just checking; this also showed many npm modules added + removed which is OK as our dependencies have changed
gitpod /workspace/infragram (gh-pages|MERGING) $ git add package* index.html # adding all 3 files
gitpod /workspace/infragram (gh-pages|MERGING) $ git merge --continue # picking back up on the merge we're still in the middle of
gitpod /workspace/infragram (gh-pages) $ git log # confirming that the new commits are now in the history
gitpod /workspace/infragram (gh-pages) $ git push -f https://github.com/jywarren/infragram.git  HEAD:gh-pages # ok, force pushing this up to my fork's gh-pages remote branch
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 29.43 KiB | 4.20 MiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: 
remote: Create a pull request for 'gh-pages' on GitHub by visiting:
remote:      https://github.com/jywarren/infragram/pull/new/gh-pages
remote: 
To https://github.com/jywarren/infragram.git
 * [new branch]      HEAD -> gh-pages

OK, so now I think i'm in the same position you were -- https://jywarren.github.io/infragram/index2.html doesn't load any of the node_modules folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions