SlideShare a Scribd company logo
Automating Google
Lighthouse
Hamlet Batista // RankSense
SLIDESHARE.NET/HAMLETBATISTA
@hamletbatista
2 October | Brighton Centre | 10 Years of brightonSEO
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
YESSSS!
This Photo by Unknown Author is licensed under CC BY-NC-ND
THE NEXT
DAY...
This Photo by Unknown Author is licensed under CC BY-SA
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
HOW CAN WE
AVOID THIS?
Automating Google Lighthouse
AGENDA
HERE IS WHAT WE ARE GOING TO DO:
• Set up a test Gatsby site and deploy it to Netlify
• Set up a Github repository for the site
• Add Github Action to run Lighthouse CI automatically
when new changes are published
• Set up performance budgets to halt deployment to
production if changes lower page speed performance
• Set up a LightHouse CI server to host the reports and to
visualize changes overtime
GATSBY
ECOMMERCE
EXAMPLE
Setting up Gastby with
an ecommerce template site
Automating Google Lighthouse
Automating Google Lighthouse
npm install -g gatsby-cli
LET’S USE A STARTER SITE FROM
https://www.gatsbyjs.org/starters/?v=2
Automating Google Lighthouse
STATIC SITE GENERATION
GIT WORKFLOW INTEGRATION
https://www.netlifycms.org/
OUR CMS IS
NETLIFY CMS
gatsby new gatsby-starter-netlify-cms https://github.com/netlify-
templates/gatsby-starter-netlify-cms
cd gatsby-starter-netlify-cms
gatsby develop
SET UP GITHUB CONNECTION
git config --global user.email hamletb@ranksense.com
git config --global user.name ”Hamlet Batista”
GATSBY AND
NETLIFY CMS
SUMMARY GATSBY RUNS PAGES REALLY
FAST THANKS TO STATIC SITE
GENERATION
NETLIFY CMS PROVIDES A UI TO
ALLOW FOR REGULAR CHANGES
IN A GIT WORKFLOW
GITHUB AND
NETLIFY
Setting up a Github repo to host the
source code of the site
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
Automating Google Lighthouse
GITHUB AND
NETLIFY
SUMMARY GITHUB NOTIFIES NETLIFY OF
CHANGES IN THE REPO
THROUGH WEBHOOKS
NETLIFY DEPLOYS CHANGES TO
THEIR CDN ONCE IT RECEIVES
THE NOTIFICATIONS
LIGHTHOUSE CI
AND GITHUB
Setting up Lighthouse CI
as a Github Action
Automating Google Lighthouse
• COMMAND LINE TOOL
• SERVER WITH STORAGE AND REPORTING UI
https://github.com/GoogleChrome/lighthouse-ci
LIGHTHOUSE CI
USE CASES
Get a Lighthouse report alongside every pull request.
Prevent regressions in accessibility, SEO, offline support, and performance best practices.
Track performance metrics and Lighthouse scores over time.
Set and keep performance budgets on scripts and images.
Run Lighthouse many times to reduce variance.
Compare two versions of your site to find improvements and regressions of individual resources.
Automating Google Lighthouse
TOO
SLOW
Automating Google Lighthouse
Automating Google Lighthouse
ADDING THE
LIGHTHOUSE
CI ACTION TO
THE REPO
git clone https://github.com/hamletbatista/gatsby-
starter-netlify-cms.git
cd gatsby-starter-netlify-cms
mkdir .github/workflows/
cd .github/workflows/
Adding the Lighthouse CI
Action to the repo (cont.)
• This is the file
.github/workflows/main.yml
• This is all we need to create a test
action
• I left the test URLs in the example.
We will change them later
Adding the Lighthouse CI
Action to the repo (cont.)
• git add .
• git commit -m "added LHCI action"
• git push origin master
Automating Google Lighthouse
LIGHTHOUSE
AND GITHUB
SUMMARY LIGHTHOUSE CI CAN CHECK URLS
FROM THE COMMAND LINE AND
GENERATE REPORTS ON DEMAND
LHCI GITHUB ACTION ALLOWS US TO
RUN LHCI ON COMMITS TO THE REPO
PERFORMANCE
BUDGETS
Setting up Lighthouse
CI performance budgets
Automating Google Lighthouse
Automating Google Lighthouse
ADDING A
PERFORMAN
CE BUDGET
ADDING A
PERFORMANCE
BUDGET (CONT.)
Adding a performance
budget (cont.) • git add ../../budget.json
• git commit -
m ”added budget.json to home dir”
• git push origin master
Automating Google Lighthouse
PERFORMANCE
BUDGETS
SUMMARY LIGHTHOUSE SUPPORTS BUDGETS TO
PREVENT REGRESSIONS
WHEN BUDGETS ARE EXCEEDED, THE
BUILD STOPS AND PREVENTS
DEPLOYMENT
LIGHTHOUSE CI
SERVER
Setting up Lighthouse CI server with a
Postgres backend to host the reports
Automating Google Lighthouse
Setting up the
Lighthouse CI Server
• npm install -D @lhci/cli @lhci/server
SETTING
UP THE
LIGHTHOUSE
CI SERVER
(CONT.)
SETTING UP
POSTGRES
• Create an instance
• Set up user and password
• Create a database named lighthouse
• Find your LHCI server P using:
curl ifconfig.co
• In Connections, add this IP to whitelist it.
For example, 35.196.34.79/32
CREATE A
POSTGRES
CONNECTION
URL
For example:
postgres://postgres:<password>@<IP
of database instance>/lighthouse
This will allow the LHCI Server to
persist the reports to the database
we created
STARTING
THE LHCI
SERVER
First, we need to install the Postgres driver for Node using:
npm install -g pg
lhci server --storage.sqlDialect=postgres --
storage.sqlConnectionUrl="postgres://postgres:<password>@<DB
IP>/lighthouse”
We get “Server listening on port 9001”
STARTING
THE LHCI
SERVER
First, we need to install the Postgres driver for Node using:
npm install -g pg
lhci server --storage.sqlDialect=postgres --
storage.sqlConnectionUrl="postgres://postgres:<password>@<DB
IP>/lighthouse”
We get “Server listening on port 9001”
First time we run it we get this screen
Initialize the LHCI
Server
• lhci wizard
LIGHTHOUSE
CI SERVER AND
POSTGRES
SUMMARY LHCI SERVER CAN PERSIST
REPORTS TO A DATABASE
WE CHOOSE POSTGRES WHICH ALLOWS
US TO CONNECT DIRECTLY FROM DATA
STUDIO LATER
SENDING REPORTS
TO LHCI SERVER
Setting up our LHCI Github Action to upload
reports to the LHCI Server on every push
Automating Google Lighthouse
Updating our workflow
definition
• We add three lines to replace the
temporary storage
• upload.serverBaseUrl: ${{
secrets.LHCI_SERVER }}
• upload.token: ${{
secrets.LHCI_TOKEN }}
ADDING
SETTINGS AS
GITHUB
SECRETS
SENDING
REPORTS TO
LHCI SERVER
SUMMARY LHCI GITHUB ACTION CAN SEND
REPORTS DIRECTLY TO A LHCI SERVER
GITHUB SECRETS CAN KEEP THE
ADDRESS OF THE LHCI SERVER AND
TOKEN PRIVATE
We offer guaranteed PSI scores of
+70 in mobile and +80 in desktop
for Shopify stores
Visit to learn more
https://bit.ly/2ECAr6z
THANK YOU
@hamletbatista
https://www.ranksense.com

More Related Content

PDF
Semantic Search Engine: Semantic Search and Query Parsing with Phrases and En...
PPTX
The Reason Behind Semantic SEO: Why does Google Avoid the Word PageRank?
PDF
Antifragility in Digital Marketing
PPTX
BrightonSEO March 2021 | Dan Taylor, Image Entity Tags
PPTX
How to Automatically Subcategorise Your Website Automatically With Python
PPTX
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
PPTX
Keyword Research and Topic Modeling in a Semantic Web
PPTX
Python for SEO
Semantic Search Engine: Semantic Search and Query Parsing with Phrases and En...
The Reason Behind Semantic SEO: Why does Google Avoid the Word PageRank?
Antifragility in Digital Marketing
BrightonSEO March 2021 | Dan Taylor, Image Entity Tags
How to Automatically Subcategorise Your Website Automatically With Python
Opinion-based Article Ranking for Information Retrieval Systems: Factoids and...
Keyword Research and Topic Modeling in a Semantic Web
Python for SEO

What's hot (20)

PPTX
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
PDF
40 Deep #SEO Insights for 2023
PPTX
Lexical Semantics, Semantic Similarity and Relevance for SEO
PDF
Passage indexing is likely more important than you think
PDF
The Python Cheat Sheet for the Busy Marketer
PDF
Log File Analysis
PPTX
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
PPTX
Semantic Publishing and Entity SEO - Conteference 20-11-2022
PDF
How to Incorporate ML in your SERP Analysis, Lazarina Stoy -BrightonSEO Oct, ...
PDF
A beginner's guide to machine learning for SEOs - WTSFest 2022
PPTX
How Search Works
PPTX
BrightonSEO - Master Crawl Budget Optimization for Enterprise Websites
PDF
7 E-Commerce SEO Mistakes & How to Fix Them #DeepSEOCon
PDF
Python For SEO specialists and Content Marketing - Hand in Hand
PDF
How to construct your own SEO a b split tests (for free) - BrightonSEO July 2021
PDF
Natural Semantic SEO - Surfacing Walnuts in Densely Represented, Every Increa...
PDF
[LondonSEO 2020] BigQuery & SQL for SEOs
PPTX
BrightonSEO: How to generate 8 million SEO test ideas - Will Critchlow
PDF
BrightonSEO October 2022 - Martijn Scheybeler - SEO Testing: Find Out What Wo...
PPTX
Beth Barnham Schema Auditing BrightonSEO Slides.pptx
Natural Language Processing and Search Intent Understanding C3 Conductor 2019...
40 Deep #SEO Insights for 2023
Lexical Semantics, Semantic Similarity and Relevance for SEO
Passage indexing is likely more important than you think
The Python Cheat Sheet for the Busy Marketer
Log File Analysis
Search Query Processing: The Secret Life of Queries, Parsing, Rewriting & SEO
Semantic Publishing and Entity SEO - Conteference 20-11-2022
How to Incorporate ML in your SERP Analysis, Lazarina Stoy -BrightonSEO Oct, ...
A beginner's guide to machine learning for SEOs - WTSFest 2022
How Search Works
BrightonSEO - Master Crawl Budget Optimization for Enterprise Websites
7 E-Commerce SEO Mistakes & How to Fix Them #DeepSEOCon
Python For SEO specialists and Content Marketing - Hand in Hand
How to construct your own SEO a b split tests (for free) - BrightonSEO July 2021
Natural Semantic SEO - Surfacing Walnuts in Densely Represented, Every Increa...
[LondonSEO 2020] BigQuery & SQL for SEOs
BrightonSEO: How to generate 8 million SEO test ideas - Will Critchlow
BrightonSEO October 2022 - Martijn Scheybeler - SEO Testing: Find Out What Wo...
Beth Barnham Schema Auditing BrightonSEO Slides.pptx
Ad

Similar to Automating Google Lighthouse (20)

PDF
Performance Monitoring with Google Lighthouse
PDF
Build a chatroom!
PDF
WordCamp Athens 2017 - Building an E-commerce Progressive Web App with React ...
PPTX
Using the WordPress REST API and Gatsby.js
DOCX
Introduction to SEO with Google Lighthouse
PDF
Pump up the JAM with Gatsby
PDF
Lighthouse
PPTX
Build Fast WordPress Site With Gatsby
PPTX
Creating Your Own Static Website Generator
PDF
GraphQL Bangkok Meetup 6.0
PDF
Modern Static Site with GatsbyJS
PDF
Lighthouse
PPTX
Library Carpentry Git, GitHub and GitPages Introduction Slides
PDF
JAMstack with gatsby, contentful and netlify aka the dream stack
PDF
Final gatsby + wagtail - Inclusive product week
PDF
implement lighthouse-ci with your web development workflow
PPTX
Shining a light on performance (js meetup)
PDF
Integrating continuous integration and deployment with GitHub’s API
PDF
Serverless Finland Meetup 16.11.2016: Messenger Bot Workshop
PDF
Wordpress vs JamStack
Performance Monitoring with Google Lighthouse
Build a chatroom!
WordCamp Athens 2017 - Building an E-commerce Progressive Web App with React ...
Using the WordPress REST API and Gatsby.js
Introduction to SEO with Google Lighthouse
Pump up the JAM with Gatsby
Lighthouse
Build Fast WordPress Site With Gatsby
Creating Your Own Static Website Generator
GraphQL Bangkok Meetup 6.0
Modern Static Site with GatsbyJS
Lighthouse
Library Carpentry Git, GitHub and GitPages Introduction Slides
JAMstack with gatsby, contentful and netlify aka the dream stack
Final gatsby + wagtail - Inclusive product week
implement lighthouse-ci with your web development workflow
Shining a light on performance (js meetup)
Integrating continuous integration and deployment with GitHub’s API
Serverless Finland Meetup 16.11.2016: Messenger Bot Workshop
Wordpress vs JamStack
Ad

More from Hamlet Batista (20)

PDF
A Deep Dive Into SEO Tactics For Modern Javascript Frameworks
PDF
Automated Duplicate Content Consolidation with Google Cloud Functions
PDF
Quality Content at Scale Through Automated Text Summarization of UGC
PDF
SEO Meets Automation
PDF
Creando una Sección de FAQS y su Marcado de Datos Estructurados en 30 Minutos
PPTX
Doing More with Less: Automated, High-Quality Content Generation
PPTX
How to scale SEO work NOBODY wants to do (including your competitors) to rapi...
PPTX
Agile SEO: Faster SEO Results
PPTX
Scaling Keyword Research to Find Content Gaps
PPTX
Query Classification on Steroids with BERT
PPTX
Solving Complex JavaScript Issues and Leveraging Semantic HTML5
PPTX
Python for Data-driven Storytelling
PPTX
Scaling automated quality text generation for enterprise sites
PPTX
The New Renaissance of JavaScript
PPTX
Data and Evidence-driven SEO
PPTX
Advanced Data-Driven SEO
PPTX
Technical SEO "Overoptimization"
PPTX
Why Pay for Performance When You Can Lead the World To Your Door for Free?
PPTX
Gettin' It Up And Keepin' It Up in Google
PPTX
Batista, Hamlet, Beyond The Usual Link Building
A Deep Dive Into SEO Tactics For Modern Javascript Frameworks
Automated Duplicate Content Consolidation with Google Cloud Functions
Quality Content at Scale Through Automated Text Summarization of UGC
SEO Meets Automation
Creando una Sección de FAQS y su Marcado de Datos Estructurados en 30 Minutos
Doing More with Less: Automated, High-Quality Content Generation
How to scale SEO work NOBODY wants to do (including your competitors) to rapi...
Agile SEO: Faster SEO Results
Scaling Keyword Research to Find Content Gaps
Query Classification on Steroids with BERT
Solving Complex JavaScript Issues and Leveraging Semantic HTML5
Python for Data-driven Storytelling
Scaling automated quality text generation for enterprise sites
The New Renaissance of JavaScript
Data and Evidence-driven SEO
Advanced Data-Driven SEO
Technical SEO "Overoptimization"
Why Pay for Performance When You Can Lead the World To Your Door for Free?
Gettin' It Up And Keepin' It Up in Google
Batista, Hamlet, Beyond The Usual Link Building

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
cuic standard and advanced reporting.pdf
PDF
KodekX | Application Modernization Development
PPTX
A Presentation on Artificial Intelligence
PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Electronic commerce courselecture one. Pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
Per capita expenditure prediction using model stacking based on satellite ima...
cuic standard and advanced reporting.pdf
KodekX | Application Modernization Development
A Presentation on Artificial Intelligence
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
The AUB Centre for AI in Media Proposal.docx

Automating Google Lighthouse