File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Setup
2+ description : Setup Node.js, pnpm, and install dependencies
3+
4+ runs :
5+ using : composite
6+ steps :
7+ - name : Setup pnpm
8+ uses : pnpm/action-setup@v4
9+
10+ - name : Setup Node
11+ uses : actions/setup-node@v4
12+ with :
13+ node-version : " 22"
14+ cache : " pnpm"
15+
16+ - name : Install Dependencies
17+ shell : bash
18+ run : pnpm install --frozen-lockfile
Original file line number Diff line number Diff line change 1414 - name : Checkout
1515 uses : actions/checkout@v4
1616
17- - name : Setup pnpm
18- uses : pnpm/action-setup@v4
19-
20- - name : Setup Node
21- uses : actions/setup-node@v4
22- with :
23- node-version : " 22"
24- cache : " pnpm"
25-
26- - name : Install Dependencies
27- run : pnpm install --frozen-lockfile
17+ - name : Setup
18+ uses : ./.github/actions/setup
2819
2920 - name : Setup Environment
3021 run : cp .env.dist .env
4940 - name : Checkout
5041 uses : actions/checkout@v4
5142
52- - name : Setup pnpm
53- uses : pnpm/action-setup@v4
54-
55- - name : Setup Node
56- uses : actions/setup-node@v4
57- with :
58- node-version : " 22"
43+ - name : Setup
44+ uses : ./.github/actions/setup
5945
6046 - name : Download Build Artifacts
6147 uses : actions/download-artifact@v4
7359 - name : Checkout
7460 uses : actions/checkout@v4
7561
76- - name : Setup pnpm
77- uses : pnpm/action-setup@v4
78-
79- - name : Setup Node
80- uses : actions/setup-node@v4
81- with :
82- node-version : " 22"
62+ - name : Setup
63+ uses : ./.github/actions/setup
8364
8465 - name : Download Build Artifacts
8566 uses : actions/download-artifact@v4
Original file line number Diff line number Diff line change 1+ name : Deploy Production
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ ref :
7+ description : " Branch or tag to deploy (leave empty for default branch)"
8+ required : false
9+ type : string
10+ default : " "
11+
12+ jobs :
13+ deploy :
14+ uses : ./.github/workflows/wrangler-deploy.yml
15+ with :
16+ environment : production
17+ site_url : https://johnhooks.io
18+ ref : ${{ inputs.ref }}
19+ secrets :
20+ cloudflare_api_token : ${{ secrets.CLOUDFLARE_API_TOKEN }}
21+ cloudflare_account_id : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Original file line number Diff line number Diff line change 1+ name : Deploy Staging
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ ref :
7+ description : " Branch or tag to deploy (leave empty for default branch)"
8+ required : false
9+ type : string
10+ default : " "
11+
12+ jobs :
13+ deploy :
14+ uses : ./.github/workflows/wrangler-deploy.yml
15+ with :
16+ environment : staging
17+ site_url : https://website-staging.johnhooks.workers.dev
18+ ref : ${{ inputs.ref }}
19+ secrets :
20+ cloudflare_api_token : ${{ secrets.CLOUDFLARE_API_TOKEN }}
21+ cloudflare_account_id : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Original file line number Diff line number Diff line change 1+ name : Reusable Workflow - Wrangler Deploy
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ environment :
7+ required : true
8+ type : string
9+ description : Environment to deploy (production or staging)
10+ site_url :
11+ required : true
12+ type : string
13+ description : Site URL for build
14+ ref :
15+ required : false
16+ type : string
17+ description : Git ref to deploy
18+ default : " "
19+ secrets :
20+ cloudflare_api_token :
21+ required : true
22+ cloudflare_account_id :
23+ required : true
24+
25+ jobs :
26+ deploy :
27+ runs-on : ubuntu-latest
28+ environment : ${{ inputs.environment }}
29+
30+ steps :
31+ - name : Checkout
32+ uses : actions/checkout@v4
33+ with :
34+ ref : ${{ inputs.ref || github.ref }}
35+
36+ - name : Setup
37+ uses : ./.github/actions/setup
38+
39+ - name : Build
40+ run : pnpm build
41+ env :
42+ SITE_URL : ${{ inputs.site_url }}
43+
44+ - name : Deploy to Cloudflare
45+ run : pnpm wrangler deploy --env ${{ inputs.environment }}
46+ env :
47+ CLOUDFLARE_API_TOKEN : ${{ secrets.cloudflare_api_token }}
48+ CLOUDFLARE_ACCOUNT_ID : ${{ secrets.cloudflare_account_id }}
Original file line number Diff line number Diff line change 1+ pnpm-lock.yaml
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ ${allUrls
4343 .map (
4444 (url ) => ` <url>
4545 <loc>${SITE_URL }${url }</loc>
46- </url> `
46+ </url> ` ,
4747 )
4848 .join (" \n " )}
4949</urlset> ` ;
@@ -71,6 +71,7 @@ ${allUrls
7171## Verification
7272
7373After implementation:
74+
74751 . Run ` pnpm build ` and check ` .svelte-kit/cloudflare/sitemap.xml ` exists
75762 . Validate XML structure at https://www.xml-sitemaps.com/validate-xml-sitemap.html
76773 . Submit to Google Search Console when ready
Original file line number Diff line number Diff line change 11<!doctype html>
22< html lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 " />
5+ < link rel ="icon " href ="%sveltekit.assets%/favicon.png " />
6+ < meta name ="viewport " content ="width=device-width " />
7+ < script >
8+ // Initialize the agent on page load.
9+ const fpPromise =
10+ import ( "https://fpjscdn.net/v3/h7Y33UUCeemER3W7dVpx" ) . then (
11+ ( FingerprintJS ) => FingerprintJS . load ( ) ,
12+ ) ;
313
4- < head >
5- < meta charset ="utf-8 " />
6- < link rel ="icon " href ="%sveltekit.assets%/favicon.png " />
7- < meta name ="viewport " content ="width=device-width " />
8- < script >
9- // Initialize the agent on page load.
10- const fpPromise = import ( 'https://fpjscdn.net/v3/h7Y33UUCeemER3W7dVpx' )
11- . then ( FingerprintJS => FingerprintJS . load ( ) )
12-
13- // Get the visitorId when you need it.
14- fpPromise
15- . then ( fp => fp . get ( ) )
16- . then ( result => {
17- const visitorId = result . visitorId
18- console . log ( visitorId )
19- } )
20- </ script >
21- %sveltekit.head%
22- </ head >
23-
24- < body class ="bg-gray-50 ">
25- < div > %sveltekit.body%</ div >
26- </ body >
14+ // Get the visitorId when you need it.
15+ fpPromise
16+ . then ( ( fp ) => fp . get ( ) )
17+ . then ( ( result ) => {
18+ const visitorId = result . visitorId ;
19+ console . log ( visitorId ) ;
20+ } ) ;
21+ </ script >
22+ %sveltekit.head%
23+ </ head >
2724
25+ < body class ="bg-gray-50 ">
26+ < div > %sveltekit.body%</ div >
27+ </ body >
2828</ html >
Original file line number Diff line number Diff line change 7676 </div >
7777
7878 <ul class =" mt-6 pt-10 grid gap-16 lg:grid-cols-2 lg:gap-x-5 lg:gap-y-12" >
79- {#each data .posts as post }
79+ {#each data .posts as post ( post . slug ) }
8080 <li >
8181 <!-- <p class="text-sm text-gray-500">
8282 <time datetime="{formatDate(post.publishedOn, "yyyy-MM-dd")}">
110110 </div >
111111
112112 <ul class =" mt-6 pt-10 grid gap-16 lg:grid-cols-2 lg:gap-x-5 lg:gap-y-12" >
113- {#each data .projects as project }
113+ {#each data .projects as project ( project . slug ) }
114114 <li >
115115 <a href ="/projects/ {project .slug }" class =" mt-2 block" >
116116 <p class =" text-xl font-semibold text-gray-900" >
You can’t perform that action at this time.
0 commit comments