Code written on my machine and reviewed in a pull request
How it is used here: Merging the pull request puts the change on main. That push is what sets off every stage below.
Every change lands on main through a reviewed pull request. Main is protected and always deployable.
Goes to stage 2 · GitHub Actions ↓
Commit 98e2ddb on main
02
Stage 2 of 6 · GitHub Actions
GitHub Actions builds the site
↳ Comes from stage 1 · Commit
Commit 98e2ddb on main
How it is used here: The push starts the workflow. actions/checkout downloads exactly this commit, and npm run build turns its source code into plain HTML, CSS and JavaScript.
npm ci and npm run build: type checks, a fresh GitHub snapshot, and every page rendered in English and Portuguese.
The dist/ folder: every page ready, in English and Portuguese
03
Stage 3 of 6 · rsync over SSH
The files travel to the server
↳ Comes from stage 2 · GitHub Actions
The dist/ folder: every page ready, in English and Portuguese
How it is used here: rsync compares dist/ with what is already on the server and sends only the difference, over an encrypted SSH connection.
Only the files that changed go to the server, as a deploy user without sudo, with its own key and a pinned host key.
GitHub runnerSSHServer (Lightsail)
Goes to stage 4 · nginx ↓
The files in /var/www/portfolio on the server
04
Stage 4 of 6 · nginx
nginx serves the page
↳ Comes from stage 3 · rsync over SSH
The files in /var/www/portfolio on the server
How it is used here: When a request arrives, nginx finds the matching file in that folder and answers with it, adding the headers you see below.
Ubuntu on AWS Lightsail serves the static files, with long caching for fingerprinted assets and security headers.
CloudflareGET /en/pipeline/200 OK · text/htmlnginx/var/www/portfolio
Headers this page just received:
measuring…
Goes to stage 5 · Cloudflare ↓
An HTTP response: the headers below plus the HTML
05
Stage 5 of 6 · Cloudflare
Cloudflare brings it close to you
↳ Comes from stage 4 · nginx
An HTTP response: the headers below plus the HTML
How it is used here: Cloudflare fetches that response from the server over a verified certificate, keeps a copy close to you and delivers it over HTTPS.
DNS, CDN and HTTPS in front of the server, which it reaches over a verified origin certificate.
ServerCloudflarecached copyHTTPSYou
Data center
—
Protocol
—
Encryption
—
Edge cache
—
Shows up on the published site, joaoabreu.dev.
Goes to stage 6 · You ↓
The page, encrypted, leaving the data center nearest to you
06
Stage 6 of 6 · You
Your browser puts it together
↳ Comes from stage 5 · Cloudflare
The page, encrypted, leaving the data center nearest to you
How it is used here: Your browser reads the HTML, applies the CSS and runs the little JavaScript there is, which then fetches the live GitHub numbers.
Your browser gets ready-made HTML. Live GitHub data loads on top; if it fails, the build snapshot stays.
joaoabreu.dev/en/pipeline/
live
HTML
CSS
JavaScript
How long each step of this visit took:
DNS lookup—
Connection—
TLS handshake—
Server response—
Download—
Page ready—
Total
—
Transferred
—
Protocol
—
End of the journey ✓
This page, on your screen
Under load
Two API instances, one address
The pages are static, but the admin, the contact form, the visit counter and the assistant talk to a Spring Boot API. It runs as two instances behind nginx. Each visitor always reaches the same instance, chosen by a hash of their address, so a login and the request limits stay consistent; if one instance fails, nginx sends the request to the other.