Skip to content
/ lhci-cloud-run Public template

lighthouse ci server on cloud run with litestream

License

Notifications You must be signed in to change notification settings

loremaps/lhci-cloud-run

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lighthouse CI server on Google Cloud Run

PoC of running Lighthouse CI on Cloud Run, powered by litestream

Features

  • Serverless platform (scales to zero, pay-as-you-go)
  • Replication on GCS

Usage

Build the image

$ 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 

Why?

This may be the cheapest way to host a Lighthouse CI server.

Also I wanted to see if it's possible.

Credits

This PoC is heavily inspired by the Litestream/s6 Example.

Variations

See other deployment options of Lighthouse CI server.