Documentation
¶
Overview ¶
Package ghactions maps a Levelrail deploy outcome onto GitHub deployment statuses and check runs, for the GitHub Actions deploy action.
Index ¶
Constants ¶
const ( OutcomeSucceeded = "succeeded" OutcomeFailed = "failed" OutcomeTimeout = "timeout" OutcomeAccepted = "accepted" )
Deploy outcomes the CLI hands to Finish.
Variables ¶
var SkipMarkers = []string{"[skip ci]", "[ci skip]", "[skip deploy]", "[no deploy]"}
SkipMarkers are the commit message markers that stop a push from deploying.
Functions ¶
func Workflow ¶
func Workflow(o WorkflowOptions) string
Workflow renders a deploy-on-push workflow that authenticates with the job OIDC identity, waits for the rollout and rolls back to the previous image on failure.
Types ¶
type GitHub ¶
type GitHub interface {
CreateDeployment(ctx context.Context, instanceURL, token, owner, repo, ref, environment, description string, production bool) (int64, error)
CreateDeploymentStatus(ctx context.Context, instanceURL, token, owner, repo string, id int64, state githubapp.DeploymentState, environmentURL, logURL, description string) error
CreateCheckRun(ctx context.Context, instanceURL, token, owner, repo string, spec githubapp.CheckRunSpec) (int64, error)
UpdateCheckRun(ctx context.Context, instanceURL, token, owner, repo string, id int64, spec githubapp.CheckRunSpec) error
}
GitHub is the slice of the GitHub client the reporter needs.
type Outcome ¶
type Outcome struct {
DeploymentState githubapp.DeploymentState
PostDeployment bool
CheckConclusion string
Summary string
}
Outcome is how an outcome string maps onto GitHub's vocabularies.
func MapOutcome ¶
MapOutcome translates a deploy outcome into deployment and check states.
type Reporter ¶
Reporter posts deploy progress to one repository.
type Result ¶
Result carries Warnings for report calls that failed. A failed report is never fatal: the deploy outcome is the source of truth.