Skip to content

Commit

Permalink
redeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorDoyle committed Dec 4, 2024
1 parent e3db5da commit 17a9c88
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy Documentation to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"

- name: Install Dependencies
run: npm install

- name: Generate Documentation
run: npx generate-docs

- name: Build Documentation
run: cd docs/codexMaker && npm install && npm run build && npm run export

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: docs/codexMaker/out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ dist/
*.log
.DS_Store
.vscode
codex-tests/
codex-tests/
out/
.next/
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"build": "tsc",
"test": "npx generate-docs && cd docs && cd codexMaker && npm run dev",
"prepare": "npm run build",
"destroy": "rm -rf docs"
"destroy": "rm -rf docs",
"build-docs": "cd docs/codexMaker && next build && next export"
},
"keywords": [
"documentation",
Expand Down
34 changes: 34 additions & 0 deletions src/workers/fileProcessor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { parentPort, workerData } from 'worker_threads';
import { availableParsers } from '../parsers';

async function processWorkerFile() {
if (!parentPort) throw new Error('This file must be run as a worker');

try {
const { filePath, content } = workerData;

// find correct parser
const parser = availableParsers.find(p => p.canParse(filePath));
if (!parser) {
parentPort.postMessage({
functions: [],
errors: [`No parser available for file: ${filePath}`]
});
return;
}

// parse file
const result = await parser.parseFile(filePath, content);
parentPort.postMessage(result);
} catch (error) {
parentPort.postMessage({
functions: [],
errors: [`Worker error processing ${workerData.filePath}: ${(error as Error).message}`]
});
}
}

processWorkerFile().catch(error => {
console.error('Worker error:', error);
process.exit(1);
});

0 comments on commit 17a9c88

Please sign in to comment.