Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/deploy-eng.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Eng - Build and Deploy

on:
workflow_dispatch:
inputs:
bust_cache:
description: 'Force fresh API fetch (bypass disk cache)'
required: false
type: boolean
default: false
schedule:
# Here are the times for the cron:
#
Expand All @@ -28,6 +34,7 @@ jobs:

env:
BUILD_LANG: ${{ matrix.languages }}
BUST_CACHE: ${{ inputs.bust_cache }}

ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand Down Expand Up @@ -71,8 +78,16 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: node_modules/.cache/turbo
key: turbo-${{ matrix.languages }}-${{ github.sha }}
restore-keys: |
turbo-${{ matrix.languages }}-

- name: Build site
run: pnpm run build
run: pnpm turbo run build
env:
NODE_ENV: production

Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/deploy-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: i18n - Build and Deploy

on:
workflow_dispatch:
inputs:
bust_cache:
description: 'Force fresh API fetch (bypass disk cache)'
required: false
type: boolean
default: false
schedule:
# Here are the times for the cron:
#
Expand Down Expand Up @@ -29,6 +35,7 @@ jobs:

env:
BUILD_LANG: ${{ matrix.languages }}
BUST_CACHE: ${{ inputs.bust_cache }}

ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
Expand Down Expand Up @@ -88,8 +95,16 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Restore Turbo cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: node_modules/.cache/turbo
key: turbo-${{ matrix.languages }}-${{ github.sha }}
restore-keys: |
turbo-${{ matrix.languages }}-

- name: Build site
run: pnpm run build
run: pnpm turbo run build
env:
NODE_ENV: production

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ cypress/screenshots
config/i18n/locales/**/trending.json

docker/languages/

# Turborepo
.turbo
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
"cypress:run:espanol": "pnpm run cypress -- run --spec 'cypress/e2e/espanol/**/*'",
"cypress:watch": "pnpm run cypress -- open",
"dev": "pnpm run develop",
"fetch:data": "node scripts/fetch-data.js",
"predevelop": "pnpm run clean && node ./tools/download-trending.js",
"develop": "cross-env ELEVENTY_ENV=dev NODE_OPTIONS=--max-old-space-size=8192 eleventy --serve",
"predevelop:ci": "pnpm run clean && node ./tools/download-trending.js",
"develop:ci": "cross-env ELEVENTY_ENV=ci NODE_OPTIONS=--max-old-space-size=8192 eleventy --serve",
"prebuild": "pnpm run clean && node ./tools/download-trending.js",
"prebuild": "pnpm run clean",
"build": "cross-env ELEVENTY_ENV=prod NODE_OPTIONS=--max-old-space-size=8192 eleventy",
"build:ci": "cross-env ELEVENTY_ENV=ci eleventy",
"postbuild": "node ./config/i18n/generate-serve-config.js",
Expand Down Expand Up @@ -109,6 +110,7 @@
"probe-image-size": "7.2.3",
"shx": "0.4.0",
"terser": "5.44.1",
"turbo": "^2.8.14",
"typescript": "5.9.3"
},
"pnpm": {
Expand Down
100 changes: 100 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions scripts/fetch-data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { fetchFromHashnode } from '../utils/hashnode/fetch-from-hashnode.js';
import { fetchFromGhost } from '../utils/ghost/fetch-from-ghost.js';

try {
console.log('Downloading trending data...');
await import('../tools/download-trending.js');
console.log('Trending data downloaded.');

console.log('Fetching data from Hashnode and Ghost...');

const hashnodePosts = await fetchFromHashnode('posts');
const hashnodePages = await fetchFromHashnode('pages');
const ghostPosts = await fetchFromGhost('posts');
const ghostPages = await fetchFromGhost('pages');

console.log(
[
'Fetch summary:',
` Hashnode posts: ${hashnodePosts.length}`,
` Hashnode pages: ${hashnodePages.length}`,
` Ghost posts: ${ghostPosts.length}`,
` Ghost pages: ${ghostPages.length}`
].join('\n')
);
} catch (err) {
console.error('fetch-data failed:', err);
process.exit(1);
}
Loading
Loading