Skip to content

Commit

Permalink
move self-hosted GitHub runner example to recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
alekseykulikov authored Oct 1, 2021
1 parent a05205b commit b15aade
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ Run Lighthouse on each push to the repo, test performance budget, save results a

Create `.github/workflows/main.yml` with the list of URLs to audit using Lighthouse.

### GitHub Action workflow on native VM

```yml
name: Lighthouse CI
on: push
Expand All @@ -46,36 +44,6 @@ jobs:
temporaryPublicStorage: true # upload lighthouse report to the temporary storage
```
### GitHub Action workflow on self-hosted GitHub runner (e.g. on-premise)
https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners
```yml
name: Lighthouse CI
on: push
jobs:
lighthouse:
runs-on: [self-hosted, your-custom-label]
steps:
- uses: actions/checkout@v2
- name: install Node.js

- uses: browser-actions/setup-chrome@latest

- run: chrome --version
uses: actions/setup-node@v2
with:
node-version: ${{YOUR_REQUIRED_NODE_JS_VERSION}}

- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v8
with:
urls: |
https://example.com/
https://example.com/blog
[...]
```

Describe your performance budget using a [`budget.json`](https://web.dev/use-lighthouse-for-performance-budgets/).

```json
Expand Down Expand Up @@ -457,6 +425,41 @@ jobs:

</details>

<details>
<summary>GitHub Action workflow on self-hosted GitHub runner (e.g. on-premise)</summary>

#### main.yml

```yml
name: Lighthouse CI
on: push
jobs:
lighthouse:
runs-on: [self-hosted, your-custom-label]
steps:
- uses: actions/checkout@v2
- name: install Node.js
- uses: browser-actions/setup-chrome@latest
- run: chrome --version
uses: actions/setup-node@v2
with:
node-version: ${{YOUR_REQUIRED_NODE_JS_VERSION}}
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v8
with:
urls: |
https://example.com/
https://example.com/blog
[...]
```

[Learn more about hosted runners](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners)

</details>

Explore more workflows in [public examples](./.github/workflows).
Submit a pull request with a new one if they don't cover your use case.

Expand Down

0 comments on commit b15aade

Please sign in to comment.