PoC of running Lighthouse CI on Cloud Run, powered by litestream
- Serverless platform (scales to zero, pay-as-you-go)
- Replication on GCS
$ PROJECT=$(gcloud config get-value project)
$ NAME=lhci-run
$ TAG=eu.gcr.io/$PROJECT/$NAME # see https://cloud.google.com/container-registry/docs/overview#registries
$ REGION=europe-west1 # see https://cloud.google.com/run/docs/locations
$ # build the image
$ docker build -t $TAG .
$ # upload to GCR
$ docker push $TAG
$ # Create the bucket (only set the variable if you already have one)
$ GCS_BUCKET=$NAME
$ gsutil mb -c standard -l $REGION -b on gs://$GCS_BUCKET
$ gcloud beta run deploy $NAME \
--image=$TAG \
--allow-unauthenticated \
--set-env-vars=REPLICA_URL=gcs://$GCS_BUCKET/db \
--execution-environment=gen2 \
--region=$REGION
This may be the cheapest way to host a Lighthouse CI server.
Also I wanted to see if it's possible.
This PoC is heavily inspired by the Litestream/s6 Example.
See other deployment options of Lighthouse CI server.