.dependabot
.github
.storybook
cypress
dev-test
functions
img
packages
scripts
website
content
blog
docs
widgets
add-to-your-site.md
architecture.md
backends-overview.md
beta-features.md
bitbucket-backend.md
cloudinary.md
collection-types.md
configuration-options.md
contributor-guide.md
custom-widgets.md
customization.md
deploy-preview-links.md
examples.md
external-oauth-clients.md
gatsby.md
git-gateway-backend.md
github-backend.md
gitlab-backend.md
hugo.md
intro.md
jekyll.md
middleman.md
netlify-large-media.md
nextjs.md
nuxt.md
open-authoring.md
start-with-a-template.md
test-backend.md
update-the-cms-version.md
uploadcare.md
widgets.md
writing-style-guide.md
pages
.keep
data
src
static
.babelrc
.gitignore
.nvmrc
README.md
gatsby-browser.js
gatsby-config.js
gatsby-node.js
netlify.toml
package.json
site.yml
yarn.lock
.all-contributorsrc
.editorconfig
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
.prettierrc
.stylelintrc
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
babel.config.js
commitlint.config.js
cypress.json
jest.config.js
lerna.json
netlify.toml
package.json
renovate.json
setupTestFramework.js
tsconfig.json
yarn.lock
35 lines
1.4 KiB
Markdown
35 lines
1.4 KiB
Markdown
![]() |
---
|
||
|
title: GitHub
|
||
|
weight: 20
|
||
|
group: backends
|
||
|
---
|
||
|
|
||
|
For repositories stored on GitHub, the `github` backend allows CMS users to log in directly with their GitHub account. Note that all users must have push access to your content repository for this to work.
|
||
|
|
||
|
Because Github [requires a server](https://github.com/netlify/netlify-cms/issues/663#issuecomment-335023723) for authentication, Netlify facilitates basic GitHub authentication.
|
||
|
|
||
|
To enable basic GitHub authentication:
|
||
|
|
||
|
1. Follow the authentication provider setup steps in the [Netlify docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider).
|
||
|
2. Add the following lines to your Netlify CMS `config.yml` file:
|
||
|
```yaml
|
||
|
backend:
|
||
|
name: github
|
||
|
repo: owner-name/repo-name # Path to your GitHub repository
|
||
|
```
|
||
|
|
||
|
## Specifying a status for deploy previews
|
||
|
The GitHub backend supports [deploy preview links](../deploy-preview-links). Netlify CMS checks the
|
||
|
`context` of a commit's [statuses](https://help.github.com/articles/about-status-checks/) and infers
|
||
|
one that seems to represent a deploy preview. If you need to customize this behavior, you can
|
||
|
specify which context to look for using `preview_context`:
|
||
|
|
||
|
```yaml
|
||
|
backend:
|
||
|
name: github
|
||
|
repo: my/repo
|
||
|
preview_context: my-provider/deployment
|
||
|
```
|
||
|
|
||
|
The above configuration would look for the status who's `"context"` is `"my-provider/deployment"`.
|