Skip to content
Merged
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
23 changes: 15 additions & 8 deletions .github/workflows/update-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_CACHE: ${{ github.workspace }}/.npm
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
PUPPETEER_EXECUTABLE_PATH: '/usr/bin/google-chrome'

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper git operations

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -39,14 +43,18 @@ jobs:
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './scripts/package.json'
cache-dependency-path: 'scripts/package.json'
registry-url: 'https://registry.npmjs.org'

- name: Debug directory structure
- name: Install Chrome and dependencies
run: |
echo "Current directory contents:"
ls -la
echo "Scripts directory contents:"
ls -la scripts/
sudo apt-get update
sudo apt-get install -y wget gnupg
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y google-chrome-stable
google-chrome --version

- name: Install Ruby dependencies
run: |
Expand All @@ -58,8 +66,7 @@ jobs:
- name: Install Node.js dependencies
run: |
cd scripts
echo "Installing dependencies in scripts directory"
npm ci --verbose
npm install

- name: Fetch blog content
run: |
Expand Down
10 changes: 9 additions & 1 deletion scripts/fetch_blog_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ async function getInternalLinks(page) {
}

async function crawlBlog() {
const browser = await puppeteer.launch();
const browser = await puppeteer.launch({
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || null,
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu'
]
});
const page = await browser.newPage();

const visitedUrls = new Set();
Expand Down
11 changes: 10 additions & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@
},
"dependencies": {
"puppeteer": "^22.0.0"
}
},
"engines": {
"node": ">=20.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/comphy-lab/comphy-lab.github.io.git"
},
"author": "CoMPhy Lab",
"license": "MIT"
}
Loading