Git Product home page Git Product logo

actions-netlify's Introduction

actions-netlify

build-test

GitHub Actions for deploying to Netlify

Deploy URLs are commented on your pull requests and commit comments!

GitHub Deployments are also supported!

Usage

# .github/workflows/netlify.yml
name: Build and Deploy to Netlify
on:
  push:
  pull_request:
jobs:
  build:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2

      # ( Build to ./dist or other directory... )

      - name: Deploy to Netlify
        uses: nwtgck/[email protected]
        with:
          publish-dir: './dist'
          production-branch: master
          github-token: ${{ secrets.GITHUB_TOKEN }}
          deploy-message: "Deploy from GitHub Actions"
          enable-pull-request-comment: false
          enable-commit-comment: true
          overwrites-pull-request-comment: true
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
        timeout-minutes: 1

Required inputs and env

  • publish-dir (e.g. "dist", "_site")
  • NETLIFY_AUTH_TOKEN: Personal access tokens > New access token
  • NETLIFY_SITE_ID: team page > your site > Settings > Site details > Site information > API ID
    • NOTE: API ID is NETLIFY_SITE_ID.

Optional inputs

  • production-branch (e.g. "master")
  • production-deploy: Deploy as Netlify production deploy (default: false)
  • github-token: ${{ secrets.GITHUB_TOKEN }}
  • deploy-message A custom deploy message to see on Netlify deployment (e.g. ${{ github.event.pull_request.title }})
  • enable-pull-request-comment: true Comment on pull request (default: true)
  • enable-commit-comment: true Comment on GitHub commit (default: true)
  • enable-commit-status: true GitHub commit status (default: true)
  • overwrites-pull-request-comment: true Overwrites comment on pull request (default: true)
  • netlify-config-path: ./netlify.toml Path to netlify.toml (default: undefined)
  • functions-dir Netlify functions output directory (default: undefined)
  • alias Specifies the prefix for the deployment URL, must not have uppercase or special characters (default: Netlify build ID)
  • github-deployment-environment Environment name of GitHub Deployments
  • github-deployment-description Description of the GitHub Deployment
  • fails-without-credentials Fails if no credentials provided (default: false)

Paths are relative to the project's root

All paths (eg, publish-dir, netlify-config-path, functions-dir) are relative to the project's root or absolute paths.

Outputs

  • deploy-url A deployment URL generated by Netlify

Build on local

npm ci
npm run all

actions-netlify's People

Contributors

nwtgck avatar dependabot-preview[bot] avatar rajington avatar github-actions[bot] avatar nielsbom avatar tiangolo avatar peaceiris avatar imgbot[bot] avatar gvdp avatar rstacruz avatar thepushkarp avatar nojvek avatar kentaro-m avatar imgbotapp avatar fmr avatar scopsy avatar kaisermann avatar south-paw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.