Skip to content

fix(theme): eliminate initial load theme flash (FOUC) and respect sys… #9

fix(theme): eliminate initial load theme flash (FOUC) and respect sys…

fix(theme): eliminate initial load theme flash (FOUC) and respect sys… #9

name: Sync Telemetry & Deploy to GitHub Pages
on:
schedule:
# Run every Monday at 04:00 UTC
- cron: '0 4 * * 1'
push:
branches:
- main
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages and git commits
permissions:
contents: write
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
sync-build-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate catalog schema
run: pnpm run validate
- name: Fetch live GitHub telemetry
run: pnpm run sync
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit updated telemetry snapshot (if changed)
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet data/projects-enriched.json public/data/projects-enriched.json; then
git add data/projects-enriched.json public/data/projects-enriched.json
git commit -m "chore(data): auto-update telemetry snapshot [skip ci]"
git push
else
echo "No telemetry changes detected."
fi
- name: Build React showcase website
run: pnpm run build
- name: Setup GitHub Pages
uses: actions/configure-pages@v5
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4