@acta-dev/cli 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +200 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -418,6 +418,187 @@ async function installAgentSkill(cwd, format) {
418
418
  return format === "both" ? { skillPaths, agentsPath: join2(cwd, "AGENTS.md") } : { skillPaths };
419
419
  }
420
420
 
421
+ // src/commands/deploy-workflows.ts
422
+ var DEPLOY_PROVIDERS = ["pages", "cloudflare", "vercel", "netlify"];
423
+ var DEPLOY_WORKFLOW_TEMPLATES = {
424
+ pages: `name: Deploy Acta Pages
425
+
426
+ on:
427
+ push:
428
+ branches:
429
+ - main
430
+ workflow_dispatch:
431
+
432
+ permissions:
433
+ contents: read
434
+ pages: write
435
+ id-token: write
436
+
437
+ concurrency:
438
+ group: acta-pages
439
+ cancel-in-progress: false
440
+
441
+ jobs:
442
+ build:
443
+ name: Build Acta static viewer
444
+ runs-on: ubuntu-latest
445
+ steps:
446
+ - name: Checkout
447
+ uses: actions/checkout@v4
448
+
449
+ - name: Setup pnpm
450
+ uses: pnpm/action-setup@v4
451
+ with:
452
+ version: 11
453
+
454
+ - name: Setup Node
455
+ uses: actions/setup-node@v4
456
+ with:
457
+ node-version: 22
458
+
459
+ - name: Build Acta site
460
+ run: pnpm dlx @acta-dev/cli site --base "/\${{ github.event.repository.name }}"
461
+
462
+ - name: Configure Pages
463
+ uses: actions/configure-pages@v5
464
+
465
+ - name: Upload Pages artifact
466
+ uses: actions/upload-pages-artifact@v4
467
+ with:
468
+ path: .acta/site
469
+
470
+ deploy:
471
+ name: Deploy to GitHub Pages
472
+ needs: build
473
+ runs-on: ubuntu-latest
474
+ environment:
475
+ name: github-pages
476
+ url: \${{ steps.deployment.outputs.page_url }}
477
+ steps:
478
+ - name: Deploy Pages
479
+ id: deployment
480
+ uses: actions/deploy-pages@v4
481
+ `,
482
+ cloudflare: `name: Deploy Acta to Cloudflare Pages
483
+
484
+ on:
485
+ push:
486
+ branches:
487
+ - main
488
+ workflow_dispatch:
489
+
490
+ permissions:
491
+ contents: read
492
+
493
+ jobs:
494
+ deploy:
495
+ name: Deploy Acta static viewer
496
+ runs-on: ubuntu-latest
497
+ steps:
498
+ - name: Checkout
499
+ uses: actions/checkout@v4
500
+
501
+ - name: Setup pnpm
502
+ uses: pnpm/action-setup@v4
503
+ with:
504
+ version: 11
505
+
506
+ - name: Setup Node
507
+ uses: actions/setup-node@v4
508
+ with:
509
+ node-version: 22
510
+
511
+ - name: Build Acta site
512
+ run: pnpm dlx @acta-dev/cli site
513
+
514
+ - name: Deploy to Cloudflare Pages
515
+ uses: cloudflare/wrangler-action@v3
516
+ with:
517
+ apiToken: \${{ secrets.CLOUDFLARE_API_TOKEN }}
518
+ accountId: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
519
+ command: pages deploy .acta/site --project-name="\${{ vars.CLOUDFLARE_PROJECT_NAME }}"
520
+ `,
521
+ vercel: `name: Deploy Acta to Vercel
522
+
523
+ on:
524
+ push:
525
+ branches:
526
+ - main
527
+ workflow_dispatch:
528
+
529
+ permissions:
530
+ contents: read
531
+
532
+ jobs:
533
+ deploy:
534
+ name: Deploy Acta static viewer
535
+ runs-on: ubuntu-latest
536
+ steps:
537
+ - name: Checkout
538
+ uses: actions/checkout@v4
539
+
540
+ - name: Setup pnpm
541
+ uses: pnpm/action-setup@v4
542
+ with:
543
+ version: 11
544
+
545
+ - name: Setup Node
546
+ uses: actions/setup-node@v4
547
+ with:
548
+ node-version: 22
549
+
550
+ - name: Build Acta site
551
+ run: pnpm dlx @acta-dev/cli site
552
+
553
+ - name: Deploy to Vercel
554
+ run: pnpm dlx vercel .acta/site --prod --yes --token="\${{ secrets.VERCEL_TOKEN }}"
555
+ env:
556
+ VERCEL_ORG_ID: \${{ secrets.VERCEL_ORG_ID }}
557
+ VERCEL_PROJECT_ID: \${{ secrets.VERCEL_PROJECT_ID }}
558
+ `,
559
+ netlify: `name: Deploy Acta to Netlify
560
+
561
+ on:
562
+ push:
563
+ branches:
564
+ - main
565
+ workflow_dispatch:
566
+
567
+ permissions:
568
+ contents: read
569
+
570
+ jobs:
571
+ deploy:
572
+ name: Deploy Acta static viewer
573
+ runs-on: ubuntu-latest
574
+ steps:
575
+ - name: Checkout
576
+ uses: actions/checkout@v4
577
+
578
+ - name: Setup pnpm
579
+ uses: pnpm/action-setup@v4
580
+ with:
581
+ version: 11
582
+
583
+ - name: Setup Node
584
+ uses: actions/setup-node@v4
585
+ with:
586
+ node-version: 22
587
+
588
+ - name: Build Acta site
589
+ run: pnpm dlx @acta-dev/cli site
590
+
591
+ - name: Deploy to Netlify
592
+ run: pnpm dlx netlify-cli deploy --dir=.acta/site --prod
593
+ env:
594
+ NETLIFY_AUTH_TOKEN: \${{ secrets.NETLIFY_AUTH_TOKEN }}
595
+ NETLIFY_SITE_ID: \${{ secrets.NETLIFY_SITE_ID }}
596
+ `
597
+ };
598
+ function isDeployProvider(value) {
599
+ return DEPLOY_PROVIDERS.includes(value);
600
+ }
601
+
421
602
  // src/commands/init.ts
422
603
  var ADR_TEMPLATE = `---
423
604
  id: ADR-0000
@@ -631,6 +812,10 @@ var initCommand = defineCommand3({
631
812
  description: "Install GitHub Actions workflow template",
632
813
  default: false
633
814
  },
815
+ deploy: {
816
+ type: "string",
817
+ description: "Install a deploy workflow template: pages, cloudflare, vercel or netlify"
818
+ },
634
819
  skill: {
635
820
  type: "boolean",
636
821
  description: "Compatibility alias for `acta skill --init` after scaffolding",
@@ -645,6 +830,10 @@ var initCommand = defineCommand3({
645
830
  async run({ args }) {
646
831
  const cwd = resolve2(process.cwd());
647
832
  const yes = args.yes;
833
+ const deploy = args.deploy;
834
+ if (deploy !== void 0 && !isDeployProvider(deploy)) {
835
+ return exitUsage(`Expected --deploy to be one of: ${DEPLOY_PROVIDERS.join(", ")}.`);
836
+ }
648
837
  const config = resolveConfig3({}, { rootDir: cwd });
649
838
  printLine("Initializing Acta docs structure...");
650
839
  printLine();
@@ -687,6 +876,17 @@ var initCommand = defineCommand3({
687
876
  const workflowWritten = await safeWriteFile(workflowPath, GITHUB_ACTION_TEMPLATE, yes);
688
877
  if (workflowWritten) printSuccess(`Created ${workflowPath}`);
689
878
  }
879
+ if (deploy !== void 0) {
880
+ const workflowsDir = join3(cwd, ".github", "workflows");
881
+ await mkdir2(workflowsDir, { recursive: true });
882
+ const workflowPath = join3(workflowsDir, `acta-deploy-${deploy}.yml`);
883
+ const workflowWritten = await safeWriteFile(
884
+ workflowPath,
885
+ DEPLOY_WORKFLOW_TEMPLATES[deploy],
886
+ yes
887
+ );
888
+ if (workflowWritten) printSuccess(`Created ${workflowPath}`);
889
+ }
690
890
  if (args.skill) {
691
891
  const result = await installAgentSkill(cwd, "both");
692
892
  for (const skillPath of result.skillPaths) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acta-dev/cli",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Acta CLI — TypeScript-first docs-as-code tooling for ADR and spec documents in Git. Provides the `acta` binary.",
5
5
  "keywords": [
6
6
  "adr",