docs: add self-hosted runner setup (closes #937)
This commit is contained in:
BIN
.github/readme/imgs/setup_selfhosted_create.dark.png
vendored
Normal file
BIN
.github/readme/imgs/setup_selfhosted_create.dark.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
.github/readme/imgs/setup_selfhosted_create.light.png
vendored
Normal file
BIN
.github/readme/imgs/setup_selfhosted_create.light.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
37
.github/readme/partials/documentation/selfhosted.md
vendored
Normal file
37
.github/readme/partials/documentation/selfhosted.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# 🏠 Run metrics on self-hosted runners
|
||||
|
||||
## 0️ Setup a self-hosted runner
|
||||
|
||||
Learn more about hosting runners on [GitHub documentation](https://docs.github.com/en/actions/hosting-your-own-runners).
|
||||
|
||||
> ⚠️ To run *metrics* on a self-hosted runner, the following dependencies needs to be installed on runner:
|
||||
> - [docker](https://www.docker.com)
|
||||
> - [jq](https://github.com/stedolan/jq)
|
||||
|
||||
Go to repository settings, and select `Runners` under the `Actions` side tab.
|
||||
|
||||

|
||||

|
||||
|
||||
> ⚠️ Working user **must be able** to run docker. If *metrics* is run with an unprivileged user, ensure it can open `/var/run/docker.sock`
|
||||
>
|
||||
> Use the following workaround when receiving the following error: `dial unix /var/run/docker.sock: connect: permission denied`
|
||||
> ```bash
|
||||
> usermod -a -G docker $USER
|
||||
> chown root:docker /var/run/docker.sock
|
||||
> ```
|
||||
|
||||
## 1️ Update workflows to use self-hosted runners
|
||||
|
||||
To run *metrics* action on a self-hosted runner, uses `runs-on: self-hosted`.
|
||||
|
||||
*Example: render metrics for `github` organization*
|
||||
```yaml
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: ${{ secrets.METRICS_TOKEN }}
|
||||
```
|
||||
|
||||
> 💡 To easily debug workflow errors, use [`debug: yes`](https://github.com/lowlighter/metrics/tree/master/source/plugins/core#debug) option
|
||||
@@ -18,4 +18,5 @@ There are several ways to setup metrics, each having its advantages and disadvan
|
||||
|
||||
Additional resources for setup:
|
||||
* [🏦 Configure metrics for organizations](/.github/readme/partials/documentation/organizations.md)
|
||||
* [🏠 Run metrics on self-hosted runners](/.github/readme/partials/documentation/selfhosted.md)
|
||||
* [🧰 Template/Plugin compatibility matrix](/.github/readme/partials/documentation/compatibility.md)
|
||||
Reference in New Issue
Block a user