Skip to content

Latest commit

 

History

History
 
 

netlify-site

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Netlify Site

Serverless component that provisions netlify sites

Input Types

Name Type Description
siteEnvVars object The variables used during netlify site build
siteRepoAllowedBranches array Site Repo Branch
netlifyApiToken string
required
Your personal access token from https://app.netlify.com/account/applications
githubApiToken string
required
Your github API key from https://github.com/settings/tokens.
Github access token requires one of these scopes: repo:status, repo
siteName string
required
The netlify domain you will use for your site.
siteDomain string
required
The domain you will use to mask your netlify siteName.
siteForceSSL boolean
required
Set to true if you want to force SSL connections
siteRepo string
required
The url of your site's repository in github
siteBuildDirectory string
required
The output folder of your site's build
siteRepoBranch string
required
The production branch that will trigger builds of the netlify site

Output Types

Name Type Description
githubDeployKeyData string The GitHub deploy key
githubWebhookData any Information about the GitHub Webhook
netlifyDeployKeyData any Information about the Netlify deploy key
netlifySiteData any Information about the Netlify site data
netlifyDeployCreatedWebhook any Information about the Netlify deploy created Webhook
netlifyDeployFailedWebhook any Information about the Netlify deploy failed Webhook
netlifyDeployBuildingWebhook any Information about the Netlify deploy building Webhook

Example

type: my-application
components:
  myNetlifySite:
    type: netlify-site
    inputs:
      siteEnvVars:
        foo: bar
      siteRepoAllowedBranches:
        - master
      netlifyApiToken: xyz-123-netlify-token
      githubApiToken: abc-456-github-token
      siteName: my-awesome-site.netlify.com
      siteDomain: dog-sweatpants.com
      siteRepo: 'https://github.com/DavidWells/dog-sweatpants-frontend'
      siteBuildDirectory: build
      siteRepoBranch: master

Usage

  1. npm install component dependancies

  2. Create a netlify API token

  3. Create a github access token

  4. Configure the input values in serverless.yml

  5. Run node ../../bin/serverless deploy