https://github.com/jakepartusch/wait-for-netlify-action
A GitHub action that will wait until a Netlify Preview deploy has completed before continuing on
https://github.com/jakepartusch/wait-for-netlify-action
Last synced: about 2 months ago
JSON representation
A GitHub action that will wait until a Netlify Preview deploy has completed before continuing on
- Host: GitHub
- URL: https://github.com/jakepartusch/wait-for-netlify-action
- Owner: JakePartusch
- License: mit
- Created: 2020-01-06T16:00:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-20T23:02:05.000Z (about 1 year ago)
- Last Synced: 2025-05-07T20:09:47.221Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.34 MB
- Stars: 48
- Watchers: 2
- Forks: 54
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Wait for Netlify — A GitHub 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.
## Inputs
### `site_name`
**Required** The name of the Netlify site to reach `https://{site_name}.netlify.app`
### `request_headers`
Optional — Stringified HTTP Header object key/value pairs to send in requests (eg. `'{ "Authorization": "Basic YWxhZGRpbjpvcGVuc2VzYW1l }'`)
### `max_timeout`
Optional — The amount of time to spend waiting on Netlify. Defaults to `60` seconds
### `base_path`
Optional — The page that needs to be tested for 200. Defaults to "/" (eg: `https://{site_name}.netlify.app{base_path}`)
## Outputs
### `url`
The netlify deploy preview url that was deployed.
## Example usage
Basic Usage
```yaml
steps:
- name: Waiting for 200 from the Netlify Preview
uses: jakepartusch/[email protected]
id: waitFor200
with:
site_name: "jakepartusch"
max_timeout: 60
```Complete example with Lighthouse
```yaml
name: Lighthouseon: [pull_request]
jobs:
build:
runs-on: ubuntu-lateststeps:
- 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: jakepartusch/[email protected]
id: waitFor200
with:
site_name: "jakepartusch"
- name: Lighthouse CI
run: |
npm install -g @lhci/[email protected]
lhci autorun --upload.target=temporary-public-storage --collect.url=${{ steps.waitFor200.outputs.url }} || echo "LHCI failed!"
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
```