Error 404 when I tried to access my website - github

Recently I tried to make a website using HTML and CSS and then I tried to host it on GitHub by commit under a repository name myname_examp.github.io, but when I tried to access it through the web browser using myname_examp.github.io there was an error 404.
Is there some steps to do?

If your Github account is free tire, the Github pages repo must be public.
If you are using GitHub Enterprise Cloud and has access control, the site can only be accessed by people with read access to the repository where the site is published from.
You can use actions status to check whether your site ready:
See more on Github docs
BTW, if your site is project type (repo not named user/org.github.io), you shall go to repo setting enable pages.

Related

Is there any way to filter GitHub repo that is GitHub page enabled?

I want to know which of my repos are GitHub page enabled.
Is there any way to do this with API v3 or v4?
I am new to github. Sample code will be very appreciated.
You can use the GitHub API rpeos Pages
The GitHub Pages API retrieves information about your GitHub Pages configuration, and the statuses of your builds.
Information about the site and the builds can only be accessed by authenticated owners, even if the websites are public.
In GitHub Pages API endpoints with a status key in their response, the value can be one of:
null: The site has yet to be built.
queued: The build has been requested but not yet begun.
building:The build is in progress.
built: The site has been built.
errored: Indicates an error occurred during the build.
You can then force a GitHub Page repository to rebuild, through GitHub Action, if you want.

Does Github support anonymous access to workflow status badges for private repositories?

These GitHub workflow badges that show the results of GitHub Actions display fine in e.g. the GitHub README.md or when pasted as the URL in a browser with a session hooked up to GitHub.
But when accessed from Confluence Cloud using the same URL (or from an incognito browser instance) GtHub returns a not found 404 which is not surprising.
Does GitHub have a setting such as the Azure one Azure Pipelines status badge not getting displayed in markdown to make the badges public? I haven't found one so far.
(On Jenkins this option is called "Grant ViewStatus permissions for Anonymous Users".)
PS
Did some more Googling this morning and found:
Getting the status of a badge from a private repository
Workflow/actions status badge giving 404 on private repo in an organization
but the solution in the second link doesn't work for me.

Should GitHub Pages https:<moniker>.github.io/<repo> point to Read-the-docs build?

I have a GitHub repo of docs linked to my RTD account. The GitHub/RTD connection appears to be set up correctly with a functional webhook (green checks at both ends). Commits to the repo trigger a successful build on RTD as expected. RTD is an Authorized OAuth App and my RTD account is connected to my GitHub account.
Under Settings -> GitHub pages, I have tried both master branch and master branch/docs. I would expect https://moniker.github.io/repo-name/ to go to the connected RTD docs. But it just shows the repo-name/README.md file, not the repo-name.rtfd.io docs. Am I misunderstanding the linkage or the use of GitHub Pages? Or am I completely missing something? Thanks for any insight.
I put in a help desk question to GitHub and their response was:
GitHub Pages provides its own web hosting and will not integrate with external services. If you're publishing your site elsewhere GitHub Pages will not link to it.
So the answer is "no", adding the webhook only triggers a new build on commits and I do explicitly need a docs/index.html (or .md) that redirects to the RTD documentation.

How can I programmatically add resources to a GitHub Page?

I have a GitHub App set up to pull some data, authenticate with an installation token, and commit it to the associated repository every day. I would like this new data to be available on the GitHub Pages site for the repo which requires a GitHub Pages build. The GitHub App has read & write privs assigned on "Repository contents" and "Pages".
It appears that the daily commit is attempting to rebuild the page as in the repository's GitHub Pages settings after the daily commit I see:
Your site is having problems building: Page build failed.
An empty commit with my primary account (not the GitHub App) after a failed build triggers a successful rebuild as seen below.
October 23-25, 2018:
https://github.com/btouellette/HHHFreshBotRedux/commits/master
Nothing in the GitHub documentation about these generic build failures (https://help.github.com/articles/generic-jekyll-build-failures/) appears relevant as I am not using a deploy key, the primary account the GitHub App is installed on has a verified e-mail address, and I'm only pushing static files and not using Jekyll at all.
Since I'm already authenticating with the GitHub API to commit the file I attempted to utilize the API endpoint to manually request a page build (https://developer.github.com/v3/repos/pages/#request-a-page-build). The documentation says this endpoint is enabled for GitHub Apps but when I attempt to call it I get the response "Resource not accessible by integration".
Is there some way to address the build failures, to get the page build API endpoint working with the GitHub App, or to find another way to make new files available on the GitHub Pages site progammatically?
By using 'basic' authentication in octokit and providing explicit user and password I'm able to successfully request a pages build. The build endpoint is enabled for GitHub Apps but only for user-to-server requests where the app is acting as a user with user credentials.
Alternately I found that I can reference the raw content in the GitHub repository directly rather than using relative links from within the GitHub Pages site. This works but having the files in the pages build is better as they are served via CDN.
So by using full URLs like:
https://raw.githubusercontent.com/btouellette/HHHFreshBotRedux/master/docs/daily/20181025.json
Instead of relative URLs for the GitHub Pages site like:
"daily/20181025.json"
I'm able to grab files in Javascript that have not been added to the GitHub Pages build but have been made available in the repository and use them to build out the site dynamically.

Github page using hexo, how to get my theme supported?

I want to host a simple blog on Github pages. Therefore I set up a repository and used Hexo as a compile and deployment tool.
After testing my site locally I run the following command:
hexo deploy --generate
Sadly I, just a few seconds later, get the following message from Github:
The page build failed with the following error:
The hacker theme is not currently supported on GitHub Pages. For more
information, see
https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site.
For information on troubleshooting Jekyll see:
https://help.github.com/articles/troubleshooting-jekyll-builds
If you have any questions you can contact us by replying to this
email.
How can I publish my site using the hacker theme? If this is not possible which themes are supported by Github? How do I use them with Hexo?
Bypassing Jekyll on GitHub Pages
It is now possible to completely bypass Jekyll processing on GitHub
Pages by creating a file named .nojekyll in the root of your pages
repo and pushing it to GitHub. This should only be necessary if your
site uses files or directories that start with underscores since
Jekyll considers these to be special resources and does not copy them
to the final site.
Source: https://github.com/blog/572-bypassing-jekyll-on-github-pages
[..] I used the username.github.io repo and deployed directly to master
and it works!
https://github.com/CodeDaraW/Hacker/issues/9