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@2bd56fd853ba69f656415285cb4d10d80e4bb15bEntrypoint
Return Type
AstroApi Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@2bd56fd853ba69f656415285cb4d10d80e4bb15b 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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@2bd56fd853ba69f656415285cb4d10d80e4bb15b call \
lint --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@2bd56fd853ba69f656415285cb4d10d80e4bb15b call \
typecheck --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@2bd56fd853ba69f656415285cb4d10d80e4bb15b call \
build --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@2bd56fd853ba69f656415285cb4d10d80e4bb15b call \
megalint --source DIR_PATHfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/chirag127/workflows/dagger/astro-api@2bd56fd853ba69f656415285cb4d10d80e4bb15b call \
ci --source DIR_PATHfunc (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)
}