Update hosted website files directly from github - github

Is there any way to update my website (php) files (hosted on godaddy server) directly from GitHub?

You can edit file from the GitHub web interface.
Since yesterday, you even can upload new files from the same interface.
In both case, that will trigger a pushEvent that you can associate to a WebHook. If you have on that godaddy server a listener for that push event, you will be able to pull from your GitHub repo and update your website.
See for instance the project fiddus/github-webhooks-listener.

Related

Jekyll workflow on GitHUB creates website in a subdomain

I created my website using the tutorial available at
https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll
I used /docs as origin of the data and pushed the website as described.
I successfully created the website rosarioiacono.github.io using Jekyll.
Now I wanted to change the name of the website. To do so, I decided to delete the previous repository and start the process again.
I deleted the repository and removed the origin.
I then started the process trying to create the website datagronomist.io, but at the end, what I get is a website with the address https://rosarioiacono.github.io/datagronomist.github.io/
I would need some help to do that.

Error 404 when I tried to access my website

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.

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.

Send webdriver/eclipse project via a link

I have developed a webdriver automation script on eclipse. I need to share the project as a whole with someone. How do I send it as a link via github repo or via a zip file (github preferred) without any data being lost?
You can push your code to GitHub and add the consumer to the GitHub repo under settings->collaborators. He should be able to view the repository once you do that.

Update my website from a github repository

I use a website for testing purposes. Part of what I test is a public repository on GitHub. What I would like to do is have my site periodically check the repository and pull any changes to a folder in my site.
I'm using a LAMP server, is there some php and a cronjob that I can use to check and get the files from the repository?
I would use the webhooks Github allows. See here for a simple PHP example that executes a auto-pull if the Github repository gets updated.