Jonathan
Jonathan

Reputation: 3467

GitHub pages are not updating

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

Upvotes: 152

Views: 158656

Answers (30)

J B
J B

Reputation: 440

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.

enter image description here

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)

Upvotes: 2

orafaelreis
orafaelreis

Reputation: 2881

None of these solutions solved it for me. The solution was to edit the index.html file.

You can edit it in the GitHub website.

enter image description here

Or, edit it in your offline clone of the repo.

In either case, make a trivial, inconsequential change. For example, add a single html tag or just change whitespace. Then save/commit the change.

The website then updates on the web as expected.

Upvotes: 86

ccpizza
ccpizza

Reputation: 31801

At the bottom right of the github project page there is an Environments section as shown below:

github pages environments

Clicking github-pages with show the current status of the deployment.

After a new commit the workflow can take a while to complete and will display in Pending status.

Apparently, even after the status turns back to Active it can take some minutes for the actual changes to be seen live, so there appears to be a delay between the status change on the project page and the actual content refresh and whatever cache flushing might be happening in the github backend.

From project Settings > Pages at the top of the page you can also see the status and time of the last deployment, e.g. something like:

Last deployed by user2030 33 minutes ago.

Hovering over the minutes will show the full timestamp.

Upvotes: 3

Abid357
Abid357

Reputation: 38

In my case I had an incorrect tag closure i.e. <tag> when it should have been </tag>

Strange that my build had zero errors and my HTML page had all the content right until the point it found the incorrect tag. So I guess you could manually check all your tags to resolve such an issue.

Upvotes: 0

Brandon Rhodes
Brandon Rhodes

Reputation: 89547

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.

Upvotes: 1

AGamePlayer
AGamePlayer

Reputation: 7734

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

Upvotes: 1

CDT
CDT

Reputation: 10661

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.

Upvotes: -1

BZKN
BZKN

Reputation: 1729

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.

Upvotes: 0

Oleksa
Oleksa

Reputation: 15

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.

Upvotes: 0

KushalSeth
KushalSeth

Reputation: 4729

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)

Upvotes: 0

Mike
Mike

Reputation: 303

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

Upvotes: 14

Paresh_Wadhwani
Paresh_Wadhwani

Reputation: 33

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.

Upvotes: 0

Devansu Yadav
Devansu Yadav

Reputation: 51

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.

Upvotes: 1

Sara Onval
Sara Onval

Reputation: 124

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.

Upvotes: 3

user14073243
user14073243

Reputation:

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

Upvotes: -1

doubledherin
doubledherin

Reputation: 360

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

Upvotes: 0

anto004
anto004

Reputation: 297

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.

Upvotes: 7

Uday Sravan K
Uday Sravan K

Reputation: 1454

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"

Upvotes: 1

Shawn Tay
Shawn Tay

Reputation: 31

  1. Make sure your run npm run deploy

  2. Clear your browser cache.

Upvotes: 3

oocanto
oocanto

Reputation: 1

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.

Upvotes: 0

zmechanic
zmechanic

Reputation: 1990

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.

Upvotes: 1

eis
eis

Reputation: 53553

I had the problem of having an unverified email. The update worked for the first time, but it failed after that. A verified email is needed to trigger a GitHub pages build. Also a deploy key cannot be used for this, as it won't trigger a build.

Source: http://web.archive.org/web/20140712011932/https://help.github.com/articles/troubleshooting-github-pages-build-failures/

Disclaimer: this was the case in 2014. Don't know if it's still required.

Upvotes: 10

Martin Westin
Martin Westin

Reputation: 1427

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.

Upvotes: 1

clownfishhuman
clownfishhuman

Reputation: 135

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!

Upvotes: 0

Alex Medveshchek
Alex Medveshchek

Reputation: 685

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

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

Upvotes: 1

iamtheasad
iamtheasad

Reputation: 1127

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.

Upvotes: 1

Dan
Dan

Reputation: 301

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.

Upvotes: 5

Mytko Enko
Mytko Enko

Reputation: 19

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.

Upvotes: -1

Tristan Price
Tristan Price

Reputation: 663

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.

Upvotes: 55

Dong Justin
Dong Justin

Reputation: 137

In the repository settings, make sure the GitHub Pages is currently being built from the gh-pages branch.

Upvotes: 1

Related Questions