dagger2gha
Daggerizing your CI makes your YAML configurations smaller, but they still exist,and they're still a pain to maintain by hand.
This module aims to finish the job, by letting you generate your remaining
YAML configuration from a Dagger pipeline, written in your favorite language.
Installation
dagger install github.com/shykes/dagger2gha@v0.2.2Entrypoint
Return Type
Dagger2Gha !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| publicToken | String | - | Public Dagger Cloud token, for open-source projects. DO NOT PASS YOUR PRIVATE DAGGER CLOUD TOKEN! This is for a special "public" token which can safely be shared publicly. To get one, contact support@dagger.io |
| daggerVersion | String | "latest" | Dagger version to run in the Github Actions pipelines |
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
func (m *MyModule) Example() *dagger.Dagger2Gha {
return dag.
Dagger2gha()
}@function
def example() -> dagger.Dagger2Gha:
return (
dag.dagger2gha()
)@func()
example(): Dagger2Gha {
return dag
.dagger2gha()
}Types
Dagger2Gha 🔗
onPush() 🔗
Add a trigger to execute a Dagger pipeline on a git push
Return Type
Dagger2Gha !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| command | String ! | - | The Dagger command to execute Example 'build --source=.' |
| module | String | "." | No description provided |
| branches | [String ! ] | - | No description provided |
| tags | [String ! ] | - | No description provided |
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
on-push --command stringfunc (m *MyModule) Example(command string) *dagger.Dagger2Gha {
return dag.
Dagger2gha().
OnPush(command)
}@function
def example(command: str) -> dagger.Dagger2Gha:
return (
dag.dagger2gha()
.on_push(command)
)@func()
example(command: string): Dagger2Gha {
return dag
.dagger2gha()
.onPush(command)
}onPullRequest() 🔗
Add a trigger to execute a Dagger pipeline on a pull request
Return Type
Dagger2Gha !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| command | String ! | - | The Dagger command to execute Example 'build --source=.' |
| module | String | "." | No description provided |
| branches | [String ! ] | - | No description provided |
Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
on-pull-request --command stringfunc (m *MyModule) Example(command string) *dagger.Dagger2Gha {
return dag.
Dagger2gha().
OnPullRequest(command)
}@function
def example(command: str) -> dagger.Dagger2Gha:
return (
dag.dagger2gha()
.on_pull_request(command)
)@func()
example(command: string): Dagger2Gha {
return dag
.dagger2gha()
.onPullRequest(command)
}config() 🔗
Generate a github config directory, usable as an overlay on the repository root
Return Type
Directory ! Example
dagger -m github.com/shykes/dagger2gha@1cfbd3c2e88688dd2b6d6f7b398ad04196dcb23e call \
configfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Dagger2gha().
Config()
}@function
def example() -> dagger.Directory:
return (
dag.dagger2gha()
.config()
)@func()
example(): Directory {
return dag
.dagger2gha()
.config()
}