Skip to content
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

Cannot deploy build to GH-PAGES in this repo #18

Closed
yasushisakai opened this issue Mar 30, 2020 · 10 comments
Closed

Cannot deploy build to GH-PAGES in this repo #18

yasushisakai opened this issue Mar 30, 2020 · 10 comments
Assignees

Comments

@yasushisakai
Copy link
Contributor

clean up this repo in alignment with the standalization effort

@RELNO
Copy link
Collaborator

RELNO commented Apr 2, 2020

@yasushisakai can you help with solving this niche issue https://dev.to/javascripterika/deploy-a-react-app-as-a-github-user-page-with-yarn-3fka
TLDR: on user page, there is no gh-pages option, but all has to be deployed from master. I don't know if this will make things weird.

@RELNO RELNO mentioned this issue Apr 2, 2020
@RELNO RELNO changed the title clean up Cannot deploy build to GH-PAGES in this repo Apr 9, 2020
@RELNO
Copy link
Collaborator

RELNO commented Apr 9, 2020

@yasushisakai any input on this? I can merge the pull but then will have to hold a SRC branch for the source, and the Master will be the build. It's not a pretty solution though

@yasushisakai
Copy link
Contributor Author

yasushisakai commented Apr 17, 2020

Just breaking down the action points:

  1. merge the dev to master
  2. build inside master branch (in /docs?)
  3. commit & push master
  4. check the url

I'm not sure about the CNAME stuff but let's see how that turns out.

@RELNO missing anything?

@RELNO
Copy link
Collaborator

RELNO commented Apr 17, 2020

I'm not sure I understand 1.
If you merge Dev to master you just have both Dev and master holding the same data, no?
My understanding is that master should be only holding a built version (same as GH-pages in other repos)

@yasushisakai
Copy link
Contributor Author

My thinking was master will show which version is actually being deployed, where the dev can be still be half baked and left for discussion.
Other than hurting your eyes, Git internally keeps only one copy of the file contents across branches, so duplicate things in master and dev won't hurt in terms of storage or performance.

@RELNO
Copy link
Collaborator

RELNO commented Apr 17, 2020

Sounds good -- do you want to try and deploy to see if this can work? I'm under the assumption that master has to have only the "dirty" build, but I'll be happy to stand corrected.

@yasushisakai
Copy link
Contributor Author

yasushisakai commented Apr 17, 2020

but, if we choose, we can always delete the src part in the master (or create a pre-commit) and just leave the doc folder. To clarify, the doc is the meat right? or is at the /root level?

I'll dig in.

@RELNO
Copy link
Collaborator

RELNO commented Apr 17, 2020

doc must stay in dev as it is being read from there to the frontend.

@yasushisakai
Copy link
Contributor Author

The basic idea of the site you mentioned earlier is the same for what I was thinking, but looking into her actual user.github.io repo:
https://github.com/JavaScriptErika
looks like her project lies at the repo root. Which is slightly different than our case having cityscope folder as the project root. Where does is the location of the md doc files relate to the built react app?

@RELNO
Copy link
Collaborator

RELNO commented Apr 18, 2020

I can move the content of cityscope to the root of dev but I don't think it's necessary since we're anyway building to another branch.
As for the docfolder -- they are statically linked by the md parser, so they could be anywhere, they are never being added as part of the build:

export default () => {
    const [content, setContent] = useState();
    const { contentUrl } = useContext(AppContext);
    const globalDocsURL =

// this is the static link
"https://raw.githubusercontent.com/CityScope/cityscope.github.io/dev/";

    const thisDocURL = globalDocsURL + contentUrl;

    useEffect(() => {
        axios
            .get(thisDocURL, {
                mode: "no-cors",
            })
            .then((response) => {
                setContent(response.data);
            });
    }, [thisDocURL]);

    return (
        <div className="result-pane">
            <ReactMarkdown
                className="result"
                source={content}
                transformImageUri={(uri) =>
                    uri.startsWith("http") ? uri : `${globalDocsURL}${uri}`
                }
            />
        </div>
    );
};

@RELNO RELNO closed this as completed in cdd6b6c Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants