Compare commits
10 commits
Author | SHA1 | Date | |
---|---|---|---|
1b94b8db65 | |||
6569bc3e50 | |||
9357e8f1c0 | |||
8850943428 | |||
6fc76e29d7 | |||
7efab10371 | |||
429b05cca5 | |||
056ffe9b65 | |||
9e20764526 | |||
a856b33962 |
4 changed files with 37 additions and 7 deletions
|
@ -19,7 +19,7 @@ jobs:
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: forgejo.neshweb.net/ci-docker-images/unlighthouse-docker:${{ github.ref_name }}, forgejo.neshweb.net/ci-docker-images/unlighthouse-docker:latest
|
tags: forgejo.neshweb.net/ci-docker-images/unlighthouse:${{ github.ref_name }}, forgejo.neshweb.net/ci-docker-images/unlighthouse:latest
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
|
@ -27,7 +27,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- name: Release New Version
|
- name: Release New Version
|
||||||
uses: actions/forgejo-release@v1
|
uses: actions/forgejo-release@v2
|
||||||
with:
|
with:
|
||||||
direction: upload
|
direction: upload
|
||||||
url: https://forgejo.neshweb.net
|
url: https://forgejo.neshweb.net
|
||||||
|
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.vscode/*
|
|
@ -1,13 +1,15 @@
|
||||||
FROM node:20.10.0-bookworm
|
FROM node:20.14.0-bookworm
|
||||||
|
|
||||||
LABEL authorname="firq"
|
LABEL authorname="firq"
|
||||||
|
LABEL description="unlighthouse container for ci-based lighthouse testing"
|
||||||
WORKDIR /unlighthouse
|
WORKDIR /unlighthouse
|
||||||
|
|
||||||
# renovate: datasource=repology depName=debian_12/chromium versioning=loose
|
# renovate: datasource=repology depName=debian_12/chromium versioning=loose
|
||||||
ENV CHROMIUM_VERSION="120.0.6099.129-1~deb12u1"
|
ENV CHROMIUM_VERSION="130.0.6723.58-1~deb12u1"
|
||||||
ENV NODE_ENV='production'
|
ENV NODE_ENV='production'
|
||||||
|
|
||||||
# Update path so executable can be run globally
|
# Update path so executable can be run globally
|
||||||
ENV PATH="/unlighthouse/node_modules/.bin:${PATH}"
|
ENV PATH="/unlighthouse/node_modules/.bin:${PATH}"
|
||||||
|
|
||||||
RUN apt-get update && apt-get -y install --no-install-recommends chromium=${CHROMIUM_VERSION} procps && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get -y install --no-install-recommends chromium=${CHROMIUM_VERSION} procps && rm -rf /var/lib/apt/lists/*
|
||||||
RUN npm install @unlighthouse/cli puppeteer
|
RUN npm install @unlighthouse/cli@0.14.0 puppeteer
|
||||||
|
|
31
README.md
31
README.md
|
@ -1,3 +1,30 @@
|
||||||
# Docker image to run lighthouse, but without non-privileged user
|
# unlighthouse Docker Image
|
||||||
|
|
||||||
Uses the full node:20-bookwork image instead of slim due to issues with GitLab lighthouse Docker
|
Image based on `node:20.10.0-bookworm` with `chromium` and `unlighthouse` preinstalled.
|
||||||
|
|
||||||
|
It can be used for benchmarking a given site with lighthouse and to generate corresponding reports with ease.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The unlighthouse cli can be used by running the command `unlighthouse` inside the container
|
||||||
|
|
||||||
|
```shell
|
||||||
|
unlighthouse-ci --site "https://preview.firq.dev/"
|
||||||
|
```
|
||||||
|
|
||||||
|
It is recommended to provide a `unlighthouse.config.ts` to reduce the amount of CLI arguments needed.
|
||||||
|
|
||||||
|
An example config can be found here:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export default {
|
||||||
|
puppeteerOptions: {
|
||||||
|
args: ["--no-sandbox", "--disable-setuid-sandbox"],
|
||||||
|
},
|
||||||
|
ci: {
|
||||||
|
budget: 90,
|
||||||
|
buildStatic: true
|
||||||
|
},
|
||||||
|
outputPath: "unlighthouse-reports",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue