All Projects → South-Paw → action-netlify-deploy

South-Paw / action-netlify-deploy

Licence: MIT license
🙌 Netlify deployments via GitHub actions

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to action-netlify-deploy

changed-files
Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
Stars: ✭ 733 (+2190.63%)
Mutual labels:  actions, github-actions, github-action
netlify-build-github-actions
An example of triggering a Netlify build using Github Actions Scheduled Events
Stars: ✭ 31 (-3.12%)
Mutual labels:  actions, netlify, github-actions
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+337.5%)
Mutual labels:  actions, github-actions, github-action
clojure-dependency-update-action
A simple GitHub Actions job to create Pull Requests for outdated dependencies in clojure projects
Stars: ✭ 37 (+15.63%)
Mutual labels:  actions, github-actions, github-action
github-run-tests-action
mabl Github Actions implementation
Stars: ✭ 39 (+21.88%)
Mutual labels:  actions, github-actions, github-action
actions-deploy-gist
📌 Deploy file to Github Gist
Stars: ✭ 26 (-18.75%)
Mutual labels:  deploy, actions, github-actions
overview
Automate your workflows with GitHub actions for MATLAB.
Stars: ✭ 40 (+25%)
Mutual labels:  actions, github-actions, github-action
nrwl-nx-action
A GitHub Action to wrap Nrwl Nx commands in your workflows.
Stars: ✭ 163 (+409.38%)
Mutual labels:  actions, github-actions, github-action
build-godot-action
GitHub action that builds a Godot project for multiple platforms
Stars: ✭ 62 (+93.75%)
Mutual labels:  actions, github-actions, github-action
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-21.87%)
Mutual labels:  actions, github-actions, github-action
setup-jdk
(DEPRECATED) Set up your GitHub Actions workflow with a specific version of AdoptOpenJDK
Stars: ✭ 32 (+0%)
Mutual labels:  actions, github-actions, github-action
clang-format-action
GitHub Action for clang-format checking
Stars: ✭ 48 (+50%)
Mutual labels:  actions, github-actions, github-action
ssh2actions
Connect to GitHub Actions VM via SSH for interactive debugging
Stars: ✭ 62 (+93.75%)
Mutual labels:  actions, github-actions, github-action
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (+250%)
Mutual labels:  actions, github-actions, github-action
Github Pages Deploy Action
Automatically deploy your project to GitHub Pages using GitHub Actions. This action can be configured to push your production-ready code into any branch you'd like.
Stars: ✭ 2,507 (+7734.38%)
Mutual labels:  deploy, github-actions, github-action
recent-activity
Add your recent activity to your profile readme!
Stars: ✭ 87 (+171.88%)
Mutual labels:  actions, github-actions, github-action
slsa-provenance-action
Github Action implementation of SLSA Provenance Generation
Stars: ✭ 34 (+6.25%)
Mutual labels:  github-actions, github-action
setup-bats
GitHub Action to setup BATS testing framework
Stars: ✭ 25 (-21.87%)
Mutual labels:  github-actions, github-action
github-action-wpe-site-deploy
A GitHub Action to deploy code directly to WP Engine.
Stars: ✭ 116 (+262.5%)
Mutual labels:  actions, github-action
csharp-docs-generator
An action that generates html documentation for C# programs to use for GitHub pages.
Stars: ✭ 21 (-34.37%)
Mutual labels:  actions, github-actions

action-netlify-deploy

🙌 Netlify deployments via GitHub actions

CI Dependencies Dev Dependencies

About

A Github action that deploys a build directory to Netlify. It can be configured to comment on the commit or PR with the deploy URL or deploy with GitHub environments, deploy draft builds, deploy Netlify functions and use custom Netlify configs.

Getting started

There are 4 required inputs for the action

  • github-token which is usually ${{ secrets.GITHUB_TOKEN }}
  • netlify-auth-token this is a personal access token created from your Netlify account
  • netlify-site-id this is the API ID of your Netlify site
    • To find this, go to your site's settings and in the "site information" copy the API ID field
  • build-dir this is where your site build outputs to relative to the root of your projects folder

See the action.yml for other action inputs and their descriptions

Outputs

preview-url

The url of deployment preview.

preview-name

The name of deployment name.

Usage

Here are some ideas of how to configure this action in different workflows...

Deploying drafts on each commit and publishing on push to master

name: CI

on: [push]

jobs:
  # This job will:
  #   * deploy a draft every time there is a commit that is not on master branch
  #   * comment on that commit with the deploy URL
  deployCommitDraft:
    name: Deploy draft to Netlify
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && github.ref != 'refs/heads/master'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      # ... your other build steps to produce a build directory
      # e.g. `npm run build` for create-react-app

      - name: Deploy draft to Netlify
        uses: South-Paw/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
          build-dir: './build'
          draft: true
          comment-on-commit: true

  # This job will:
  #   * deploy a production build every time there is a push only on the master branch
  #   * comment that commit with the deploy URL
  publishMasterCommit:
    name: Publish to Netlify
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      # ... your other build steps to produce a build directory
      # e.g. `npm run build` for create-react-app

      - name: Deploy production to Netlify
        uses: South-Paw/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
          build-dir: './build'
          comment-on-commit: true

Deploying drafts of pull requests and publishing on push to master

name: CI

on:
  push:
  pull_request:
    types:
      - opened
      - synchronize

jobs:
  # This job will:
  #   * deploy a draft every time there is a pull request created or synchronized that is not on master branch
  #   * comment on that pull request with the deploy URL
  deployPRDraft:
    name: Deploy draft to Netlify
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      # ... your other build steps to produce a build directory
      # e.g. `npm run build` for create-react-app

      - name: Deploy draft to Netlify
        uses: South-Paw/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
          build-dir: './build'
          draft: true
          comment-on-pull-request: true

  # This job will:
  #   * deploy a production build every time there is a push on the master branch
  #   * comment that commit with the deploy URL
  publishMasterCommit:
    name: Publish to Netlify
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      # ... your other build steps to produce a build directory
      # e.g. `npm run build` for create-react-app

      - name: Deploy production to Netlify
        uses: South-Paw/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
          build-dir: './build'
          comment-on-commit: true

Deploying drafts of pull requests and publish on release created

name: CI

on:
  pull_request:
    types:
      - opened
      - synchronize
  release:
    types:
      - created

jobs:
  # This job will:
  #   * deploy a draft every time there is a pull request created or synchronized that is not on master branch
  #   * comment on that pull request with the deploy URL
  deployPRDraft:
    name: Deploy draft to Netlify
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' && github.ref != 'refs/heads/master'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      # ... your other build steps to produce a build directory
      # e.g. `npm run build` for create-react-app

      - name: Deploy draft to Netlify
        uses: South-Paw/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
          build-dir: './build'
          draft: true
          comment-on-pull-request: true

  # This job will:
  #   * deploy a production build every time there is a release created on the master branch
  #   * comment that commit with the deploy URL
  publishOnMasterRelease:
    name: Publish release to Netlify
    runs-on: ubuntu-latest
    if: github.event_name == 'release' && github.event.action == 'created'
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1

      # ... your other build steps to produce a build directory
      # e.g. `npm run build` for create-react-app

      - name: Deploy production to Netlify
        uses: South-Paw/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
          build-dir: './build'

Issues and Bugs

If you find any, please report them here so they can be squashed.

Development and Contributing

Download the repo and then install dependencies with npm.

# build the action to `./dist`
npm run build

# clean the `./dist` dir
npm run clean

# lint project
npm run lint

# run tests
npm run test

Contributions and improvements are always welcome 👍

License

MIT, see the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].