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.
Example
no available example in current language
// Generate a simple configuration triggered by git push on main, and pull requests
// 1. Prints "hello, main!" on push to main
// 2. Prints "hello, pull request!" on new pull request
func (m *Examples) Dagger2Gha() *dagger.Directory {
return dag.
Dagger2Gha().
OnPush("hello --name=main", dagger.Dagger2GhaOnPushOpts{
Branches: []string{"main"},
Module: "github.com/shykes/hello",
}).
OnPullRequest("hello --name='pull request'", dagger.Dagger2GhaOnPullRequestOpts{
Module: "github.com/shykes/hello",
}).
Config()
}
no available example in current language
no available example in current language
Installation
dagger install github.com/shykes/dagger2gha@v0.2.3
Entrypoint
Return Type
Dagger2Gha !
Arguments
Name | Type | 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 | Dagger version to run in the Github Actions pipelines |
Example
dagger -m github.com/shykes/dagger2gha@abbf46b713e66b8a838d6073a8b4afc763f85528 call \
func (m *myModule) example() *Dagger2Gha {
return dag.
Dagger2gha()
}
@function
def example() -> dag.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@abbf46b713e66b8a838d6073a8b4afc763f85528 call \
on-push --command string
func (m *myModule) example(command string) *Dagger2Gha {
return dag.
Dagger2gha().
OnPush(command)
}
@function
def example(command: str) -> dag.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@abbf46b713e66b8a838d6073a8b4afc763f85528 call \
on-pull-request --command string
func (m *myModule) example(command string) *Dagger2Gha {
return dag.
Dagger2gha().
OnPullRequest(command)
}
@function
def example(command: str) -> dag.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@abbf46b713e66b8a838d6073a8b4afc763f85528 call \
config
func (m *myModule) example() *Directory {
return dag.
Dagger2gha().
Config()
}
@function
def example() -> dagger.Directory:
return (
dag.dagger2gha()
.config()
)
@func()
example(): Directory {
return dag
.dagger2gha()
.config()
}