diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml new file mode 100644 index 0000000..1e72440 --- /dev/null +++ b/.github/workflows/deploy-website.yml @@ -0,0 +1,55 @@ +name: Deploy Website to Cloudflare Pages + +on: + push: + branches: [main] + paths: + - 'docs/**' + - '.github/workflows/deploy-website.yml' + workflow_dispatch: + +concurrency: + group: deploy-website + cancel-in-progress: false + +permissions: + contents: read + deployments: write + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + cache: npm + cache-dependency-path: docs/package-lock.json + + - name: Install dependencies + run: npm ci + working-directory: docs + + - name: Build + run: npm run build + working-directory: docs + + - name: Verify build output + run: | + if [ ! -d "docs/.vitepress/dist" ] || [ -z "$(ls -A docs/.vitepress/dist)" ]; then + echo "::error::Build output is empty or missing." + exit 1 + fi + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v4 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + preCommands: npx wrangler pages project create trapfall --production-branch=main || true + command: pages deploy docs/.vitepress/dist/ --project-name=trapfall --commit-dirty=true diff --git a/.github/workflows/project-sync.yml b/.github/workflows/project-sync.yml new file mode 100644 index 0000000..29d641a --- /dev/null +++ b/.github/workflows/project-sync.yml @@ -0,0 +1,74 @@ +name: Sync to CodeCorraDev Roadmap + +on: + issues: + types: [opened, reopened, closed, labeled] + # Manual trigger for backfill + workflow_dispatch: + +permissions: + issues: read + repository-projects: read + +env: + PROJECT_TOKEN: ${{ secrets.PROJECT_BOARD_TOKEN }} + PROJECT_NODE_ID: ${{ secrets.PROJECT_NODE_ID }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Sync issue to Project Board + env: + GH_TOKEN: ${{ secrets.PROJECT_BOARD_TOKEN }} + run: | + EVENT="${{ github.event.action }}" + ISSUE_NUMBER="${{ github.event.issue.number }}" + ISSUE_NODE_ID="${{ github.event.issue.node_id }}" + ISSUE_STATE="${{ github.event.issue.state }}" + REPO="${{ github.repository }}" + + echo "::group::Event Details" + echo "Event: $EVENT" + echo "Issue: #$ISSUE_NUMBER" + echo "State: $ISSUE_STATE" + echo "Repo: $REPO" + echo "Project: $PROJECT_NODE_ID" + echo "::endgroup::" + + if [ -z "$PROJECT_NODE_ID" ] || [ "$PROJECT_NODE_ID" = "" ]; then + echo "::warning::PROJECT_NODE_ID not set. Skipping." + exit 0 + fi + + add_to_project() { + local node_id="$1" + RESULT=$(gh api graphql \ + -f query=" + mutation { + addProjectV2ItemById(input: {projectId: \"$PROJECT_NODE_ID\", contentId: \"$node_id\"}) { + item { id } + } + }" 2>&1) + if echo "$RESULT" | grep -q '"item"'; then + echo "✅ Added to project" + else + echo "⚠️ Add failed (may already exist): $RESULT" + fi + } + + case "$EVENT" in + opened|reopened) + if [ "$ISSUE_STATE" = "open" ]; then + echo "Adding opened/reopened issue #$ISSUE_NUMBER..." + add_to_project "$ISSUE_NODE_ID" + fi + ;; + closed) + echo "Issue #$ISSUE_NUMBER closed — item stays in board (visibility handled by project)" + ;; + labeled) + echo "Issue #$ISSUE_NUMBER labeled — no action needed" + ;; + esac diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index cc37283..e0735c3 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -4,13 +4,16 @@ export default defineConfig({ title: 'TrapFall', description: 'Lightweight self-hosted error capture engine', lang: 'en-US', + base: '/docs/trapfall/', cleanUrls: true, head: [['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }]], themeConfig: { nav: [ + { text: 'Codecora', link: 'https://codecora.dev' }, { text: 'Guide', link: '/guide/getting-started' }, { text: 'Config', link: '/guide/configuration' }, { text: 'API', link: '/guide/api' }, + { text: 'GitHub', link: 'https://github.com/codecoradev/trapfall' }, ], sidebar: [ {