Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 2.21 KB

DEPLOY_ON_GITHUB_PAGES.md

File metadata and controls

43 lines (32 loc) · 2.21 KB

UberPage

After you forked this project and adjusted it to your needs (configured with your data), you might want to deploy it in order to make it available to everyone.

I created an overview of GitHub projects as my GitHub Page.

Deployment to GitHub Pages

This is a little guide of how to deploy this React project to GitHub Pages. You still can deploy it in a different way. This is only a suggestion.

Step 0: Create a Repository

Assuming you want to use this for a user GitHub Page and not a project GitHub Page (what's the difference?), you will need to create a dedicated repository with a special name.

At GitHub create a repository named <YourGitHubUserName>.github.io.

Step 1: Adjust the package.json configuration

In the uberpage/package.json adjust the following settings:

  • At hostname put the value <YourGitHubUserName>.github.io
  • At scripts.deploy adjust the value for the repository with git@github.com:<YourGitHubUserName>/<YourGitHubUserName>.github.io.git

Step 2: Deploy

Run the following command in the directory uberpage to deploy:

npm run deploy

This will then deploy to the master branch of the repository to the specified repository. In order to make the GitHub user page work, it has to be deployed in the master branch.

The deployment might take a couple of minutes.

Automation with Travis

If you plan to use TravisCI, you can check in this repository how to let it deploy to GitHub Pages after a successful build on the master branch.

Alternative using GitHub Actions workflow

If you like to use GitHub Actions, you can check out the .github/workflows/CI.yml in this project, which includes:

  • lint the files
  • execute tests
  • build
  • create a GitHub Release (tags only)
  • deploy to GitHub Pages (master branch only) In this case I am using a separate repository for the code and the deployed website. You can also configure this to be in the same repo.