GitHub pages are not updating

Viewed 128934

I'm running into a weird issue with GitHub pages. I pushed a new commit to my personal pages page maltzj.github.io, but the new article isn't showing up there. When I execute the server locally, a post lives at localhost:4000/posts/the-price-of-inconsistent-code/. However, when I go to http://maltzj.github.io/posts/the-price-of-inconsistent-code I get a 404. I also added a new file which should live at http://maltz.github.io/test.html, but that also throws a 404.

Everything builds and runs locally. My Git repository is up to date, and there is nothing on the GitHub status page about problems with builds, so I'm at a little bit of a loss about where to go with this. How can I get my page to update with new content that I add?

For reference, the location of the repository which backs my page is http://github.com/maltzj/maltzj.github.io

46 Answers

Go to your index.html file through your site (example.github.io/index.html) and then reload the page. Then you can go back to (example.github.io) and it should have updated. You can do the same with the master.css file, etc.

If it doesn't work, try reloading (github.com/example/example.github.io/[blob/master/]index.html) instead and it will have updated.

I had this fault today with a static page - the cause was actually a service failure at GitHub Pages itself. You can check for service messages at https://www.githubstatus.com/.

I got it to work. Mine was a simple problem. It was a browser cache problem.

I opened my link on a different browser and it showed me the updated push.

For me, I just waited ~5 minutes, and it was updated.

If someone has made the branch gh-pages from scratch (manually) the problem is that you need a file call params.json to make it work.

I don't have this params.json file, but it still works...

In my case the problem was because of my repository was private. After I made it public, the problem has gone.

The weird part of story is that I was able to create private repository and use GitHub pages with it. I did it in accordance with the official guide (http://take.ms/p2SS7). It worked fine for about 9 commits, but on the 10-th it became broken.

I ran into the same mysterious issue today. I pushed some new code to my github.io-repository, but the changes did not show up on the corresponding webpage. I inspected the page and did not see the new code in the source. I solved the issue by doing a hard reload. On Chrome, you can do a hard reload by opening up Dev Tools and right-clicking on the refresh-button and choosing Hard Reload.

In my case, my problem was after git push my GitHub file was updating but not showing my website on GitHub pages.

Note: I was creating Website by React

Also, on the HTML project, I faced the same problem. In that case, I just did first of all git pull and then git status | git add . | git commit -m"adding some content" | and git push. It worked for me.

But in the React project, it didn't work. I run this again on my cmd npm run deploy then my React web application is showing on GitHub pages.

My suggestion is to try everything showing on this post comments. Because the solution to this problem is not one.

In my case I left an empty parameter, url, in _config.yaml.

After I've specified url: example.github.io everything started to work.

I had this problem this week and no solution worked. I don't use Jekyll, only pure static HTML. It just sat three days refusing to update.

Here is what I had to do to get it to publish again.

  • Make a snapshot branch from master.
  • Reset the master branch to the last commit that is live. (Commits tab, green checkmarks indicate published commits)
  • Make a new commit with a smoke test. I made an HTML comment I could grep.
  • Force push master.
  • Check results curl https://example.com | grep SMOKETEST
  • Reset master again, removing the smoke test.
  • Cherry-pick each commit from the snapshot branch you need to get your unpublished changes back into master (cherry-picking gives the commits new ids/hashes, avoiding the risk of anything having cached them from before).
  • Force push master again.
  • Now you should get green checkmarks and published updates.

Note: It could be enough to force push to remove the commits that are stuck and getting them back again. The smoke test is almost certainly not required. Cherry-picking may not be required.

Github doesn't publish to github pages for me if I edit and commit files directly on github web site.

However, if I edit file locally and commit with GitHub Desktop, then change is published to site within seconds.

BTW, my email is verified, so this shouldn't be an issue. And I'm using same account.

  1. Make sure your run npm run deploy

  2. Clear your browser cache.

Solution worked for me for an app created using create-react-app :

  1. Go to GitHub Pages section under repository settings
  2. Change source from gh-pages branch to master branch
  3. Wait and check your custom domain website, should show master branch README.md file
  4. Now change the source back to gh-pages
  5. Wait couple minutes, now latest changes reflected on custom domain website

I had tried different solutions, none worked. Like a new commit, an empty commit, browser cache clear, wait for 5 - 10 minutes, delete gh-pages branch and push again, edit CNAME, create a new CNAME under on master branch etc

Note: My app has no _config.yaml file, no jekyll. I'm using custom domain with https (google domains). gh-page branch auto created by package.json script deploy: "gh-pages -d deploy"

In my case, I had made a couple of changes in the index.html and style.css files but those changes were not reflecting on the Github pages. But when I updated the Readme file by adding one line the Page got updated. Maybe you can try this, as it might work for you just like it did for me.

In my case there were two problems (one "pebcak" and then a more valid one).

I had two email addresses set up in GitHub and I was checking the non-primary email for build error messages (to manage emails: log in to GitHub, click on user menu on the top right, select Settings and then "Emails" from the left menu -build error messages will arrive at the primary email set).

Once I got to see the error messages I found out I had added a description, including a ":" character in my _config.yaml and since this is the character used to separate key,value pairs, it was preventing the site to build.

In my case, I had another file with the same permalink to the page that was not refreshing the content. Pay attention to that.

I used git commit -am "blah" and forgot that only my navigation links in _data/navigation.yaml were changed, and the new page.md that I created was not added to the working tree, therefore showing me a 404 error when I clicked on the link in the navigation tree.

Check, double check!

Check your build status of gh-pages in settings tab.

Your site is having problems building: Unable to build page.

If you are using github_token, it might not have permission to build the gh-pages so you might see a warning in the settings tab. That's why editing index.html might work. In this case use access_token or ssh based commit to automatically push and build gh-pages.

Go to

Settings / GitHub Pages / Source

and change it to

None (Disable GitHub Pages)

Let the system to save your changes. After that, change

Settings / GitHub Pages / Source

again to its original value.

If you're using the gh-pages command to publish, it could be a caching issue with gh-pages itself. See the bottom of the gh-pages docs:

However, note that those instructions are faulty!

To delete your gh-pages cache, either run node node_modules/gh-pages/bin/gh-pages-clean or manually delete the .cache directory in node_modules/gh-pages.

I've submitted an issue to correct the instructions here: https://github.com/tschaub/gh-pages/issues/367

I had the same issue with a very basic project. A hard reload [ctrl + shift + r] solved this for me.

Mine was just a basic project which used plain HTML, CSS, and JavaScript. The above method may or may not work for advanced projects.

I tried almost all the answers, tried editing index.html etc.

My mistake was, I was not building and deploying, so I have added build and deploy steps in my npm script. If you are using React application than directly copy paste this or just take the code.

These are my build scripts:

  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -b master -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }

Once you are done with the changes, and your application is running fine using npm start. Follow these steps:

Step 1: run the command npm run build.

If everything is good then, you will get the message: the build folder is ready to deploy

enter image description here

Step 2: run the command npm run deploy

You will get the message like this: published.

enter image description here

Step 3: Refresh your app: like https://kushalseth.github.io. Not mandatory, but do commit and push all the changes for reference.

PS: If you are facing this issues like 404 then check this answer: React Github Pages Deploy ERR_ABORTED 404 (Not Found)

I had the same problem. In my case I have replaced my avatar with a new one. Previous had extension "jpeg" and new one "jpg", so I renamed file to have the same extension as previous one. I waited one day but changes did not appear. I noticed that the build failed. I renamed file to have its correct extension and changed a html-file corresponding. Build was ready in 2 minutes.

For my personal website, I am using A Github Pages template for academic websites..

In my ._config.yaml file I have included an additional online link to a website where I have an academic profile. And this was totally unnecessary. And this link was blocking all other updates on my website. Since I removed this link in my ._config.yaml file, my all other Github pages were updated.

I made an honest effort to read through all 43 answers. Twice. Astonishingly, not one answer informs to do, what I only stumbled upon by randomly clicking different things in the github dashboard of my repo. Don't click on Settings. Click on Actions. There you will see what actually happened to the workflow when jekyll attempted to build the web page. You can click on the workflow, which will show a red 'x' mark because it failed, and see the complete text output to stdout. Including informative error messages like in my case: /usr/local/bundle/gems/jekyll-3.9.2/lib/jekyll/theme.rb:84:in `rescue in gemspec': The slate theme could not be found. (Jekyll::Errors::MissingDependencyException)

If you are deploying some simple HTML codes, try this:

First, go to Actions > Deploy static content to Page:

enter image description here

Then, click the Run workflow:

enter image description here

My site failed to deploy today because of a transient failure in the GitHub Pages deploy actions. The action needed to be re-run through the Actions tab for the new version of my site to appear.

The story:

I pushed new content, on a site that's purely static and doesn't use Jekyll. After many fruitless Shift-Ctrl-R reloads on Chrome, I decided to investigate. I first visited Settings→Pages for the site’s repository, and saw that no recent deploy had taken place.

GitHub saying the last deploy was 2 months ago

Why not, I wondered? After double-checking that my push had really gone through, I clicked the word “deployed”, and was taken to a GitHub Action that had failed!

GitHub error ECONNRESET

Since the error message ECONNRESET looked like a generic network error internal to GitHub’s network, and not any problem with my site, I clicked the “Re-run” button in the upper right and asked GitHub Actions to re-run the failed task. Within a few seconds it had been re-tried and had succeeded!

Lessons:

  1. Deploys are vulnerable to transient errors.
  2. Deploys these days happen as normal GitHub Actions that you can inspect.
  3. The deploys can be re-tried.

I had the same issue, but in my case CNAME contained the correct domain name.

I think the problem had something to do with repository renaming I did before... The online name was different from local, although there were no issues on pushing and online files got updated - the live version did not.

After deleting the repository from the local machine and cloning it from GitHub again, the problem got solved.

Make sure to clear your web history and have a go at it again. My problem was solved with that itself.

In a word:

Github pages doesn't refresh if no change is made on index.html.

So make sure to update index.html on every push.

Related