55 types : [update_blog]
66 workflow_dispatch :
77 push :
8- branches :
9- - master
10- - dev
8+ branches : [master, dev]
119 paths-ignore :
1210 - ' src/content/posts/**'
1311 - ' public/images/blog/**'
1412
1513jobs :
16- sync-blogs :
14+ sync-and-deploy :
1715 runs-on : ubuntu-latest
18- permissions :
19- contents : read
16+ # This runs the entire job inside a container that already has
17+ # Node, Chrome, and Mermaid CLI installed.
18+ container :
19+ image : minlag/mermaid-cli:latest
20+ options : --user root # Ensure we have permissions to write files
21+
2022 steps :
2123 - name : Checkout Main Repo
2224 uses : actions/checkout@v4
@@ -30,25 +32,19 @@ jobs:
3032 token : ${{ secrets.GH_PAT }}
3133 path : temp_blogs
3234
33- - name : Setup Node.js
34- uses : actions/setup-node@v4
35- with :
36- node-version : ' 20'
37-
38- - name : Install Dependencies
35+ # Note: We skip 'Install Dependencies' for system libs
36+ # because they are already in the Docker image.
37+
38+ - name : Install Project Deps
3939 run : npm ci
4040
41- - name : Install Mermaid CLI
42- run : npm install -D @mermaid-js/mermaid-cli
43-
44- - name : Install Puppeteer Dependencies
45- # mmdc requires chrome/puppeteer which might need system deps
46- run : |
47- sudo apt-get update
48- sudo apt-get install -y ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
49-
5041 - name : Process Blogs
51- run : node scripts/process-blogs.mjs
42+ run : |
43+ # Use the mmdc binary already present in the container
44+ node scripts/process-blogs.mjs
45+ env :
46+ # We tell the script to use the container's Chromium
47+ PUPPETEER_EXECUTABLE_PATH : /usr/bin/chromium-browser
5248
5349 - name : Build Project
5450 run : npm run build
5955 repoToken : ' ${{ secrets.GITHUB_TOKEN }}'
6056 firebaseServiceAccount : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_WITHNUCLEUSAI_GITHUB_IO }}'
6157 channelId : live
62- projectId : withnucleusai-github-io
58+ projectId : withnucleusai-github-io
0 commit comments