Dagger
Search

astro-api

Canonical CI pipeline for Astro static JSON APIs in the chirag127 fleet.
Same-shape as astro-site but tuned for API-shaped repos (no tests, data-first).

All script runs are `pnpm run --if-present ` so downstream repos are
free to omit any of lint / typecheck. Only `build` is required.

Deploy target: GH Pages per the api-hosting decision.
Per chirag127/workspace/knowledge/decisions/stack/dagger-confirmed-2026-07-02.md

Installation

dagger install github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d

Entrypoint

Return Type
AstroApi
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d call \
func (m *MyModule) Example() *dagger.AstroApi  {
	return dag.
			Astroapi()
}
@function
def example() -> dagger.AstroApi:
	return (
		dag.astro_api()
	)
@func()
example(): AstroApi {
	return dag
		.astroApi()
}

Types

AstroApi 🔗

lint() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d call \
 lint --source DIR_PATH
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			Astroapi().
			Lint(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.astro_api()
		.lint(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.astroApi()
		.lint(source)
}

typecheck() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d call \
 typecheck --source DIR_PATH
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			Astroapi().
			Typecheck(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.astro_api()
		.typecheck(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.astroApi()
		.typecheck(source)
}

build() 🔗

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d call \
 build --source DIR_PATH
func (m *MyModule) Example(source *dagger.Directory) *dagger.Directory  {
	return dag.
			Astroapi().
			Build(source)
}
@function
def example(source: dagger.Directory) -> dagger.Directory:
	return (
		dag.astro_api()
		.build(source)
	)
@func()
example(source: Directory): Directory {
	return dag
		.astroApi()
		.build(source)
}

megalint() 🔗

MegaLinter is opt-in per repo: set env MEGALINT=1 in the workflow_call or add dagger call megalint --source=. explicitly. NOT part of the default ci() flow — too many false positives across the fleet.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d call \
 megalint --source DIR_PATH
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			Astroapi().
			Megalint(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.astro_api()
		.megalint(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.astroApi()
		.megalint(source)
}

ci() 🔗

Full CI: lint + typecheck in parallel, then build. No tests (API repos are data-first).

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@4fa20ea6e7332d1b89d2dfaea1bd41fce8c4941d call \
 ci --source DIR_PATH
func (m *MyModule) Example(ctx context.Context, source *dagger.Directory) string  {
	return dag.
			Astroapi().
			Ci(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.astro_api()
		.ci(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.astroApi()
		.ci(source)
}