Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

A GitHub action that will wait until a Netlify Preview deploy is completed before continuing on

Notifications You must be signed in to change notification settings

JosephDuffy/wait-for-netlify-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wait for Netlify Deploy — A GitHub Action ⏱

Warning

This repo is no longer mainted. See https://github.com/archiewood/wait-for-netlify-action.

Do you have other Github actions (Lighthouse, Cypress, etc) that depend on the Netlify Preview URL? This action will wait until the url is available before running the next task.

This is a fork of JakePartusch/wait-for-netlify-action that uses the deployment for the commit, rather than for the PR.

Inputs

site_name

Required The name of the Netlify site to reach https://{site_name}.netlify.com

max_timeout

Optional — The amount of time to spend waiting on Netlify. Defaults to 60 seconds

Outputs

url

The netlify deploy preview url that was deployed.

Example usage

Basic Usage

steps:
  - name: Waiting for Netlify Preview
    uses: josephduffy/wait-for-netlify-action@v1
    id: wait-for-netflify-preview
    with:
      site_name: "YOUR_SITE_NAME"
      max_timeout: 60
Complete example with Lighthouse
name: Lighthouse

on: [pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - name: Use Node.js 12.x
        uses: actions/setup-node@v1
        with:
          node-version: 12.x
      - name: Install
        run: |
          npm ci
      - name: Build
        run: |
          npm run build
      - name: Waiting for 200 from the Netlify Preview
        uses: josephduffy/wait-for-netlify-action@v1
        id: wait-for-netflify-preview
        with:
          site_name: "YOUR_SITE_NAME"
      - name: Lighthouse CI
        run: |
          npm install -g @lhci/[email protected]
          lhci autorun --upload.target=temporary-public-storage --collect.url=${{ steps.wait-for-netflify-preview.outputs.url }} || echo "LHCI failed!"
        env:
          LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

About

A GitHub action that will wait until a Netlify Preview deploy is completed before continuing on

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%