Summary
Extend the func CLI with a func config ci command that generates a GitHub Actions workflow for building and deploying a Knative function to a Kubernetes cluster. The command creates a .github/workflows/func-deploy.yaml in the function's repository.
The generated workflow should include checkout, Kubernetes context setup, optional container registry login, func CLI installation via knative-func-action, and func deploy. It should support both local builds on the GitHub runner and remote on-cluster builds via Tekton.
Configurable via CLI flags:
--branch -- target branch (defaults to current branch)
--platform -- CI platform selection (currently GitHub only)
--remote -- remote on-cluster build via Tekton
--registry-login -- adds container registry login step
--self-hosted-runner -- uses self-hosted runner instead of ubuntu-latest
--test-step -- adds a language-specific test step (go, node, typescript, python, quarkus)
--workflow-name -- custom workflow name
--workflow-dispatch -- adds manual trigger
--force -- overwrites existing workflow files
--verbose -- prints full configuration after generation
- Custom secret/variable names for kubeconfig, registry credentials
The runtime-aware builder selection should pick the correct builder per language (host, pack, or s2i) for local and remote builds.
The feature is gated behind the FUNC_ENABLE_CI_CONFIG environment variable.
The workflow generation should live in pkg/ci/github/ so it can be used as a library by external consumers.
Resources
Pull Requests
- Fix typos in comments and documentation across the codebase. #3257
- Refactor: extract common loader/saver interfaces (Github Workflow generation prep). #3262
- Add
func config ci command skeleton. #3266
- Feature: Implement GitHub workflow generation for
func config ci. #3295
- Feature: Add registry login to CI workflows. #3297
- Feature: Add remote build and workflow dispatch options to CI workflows. #3128
- Feature: Default branch and path flags intelligently. #3371
- Feature: Add --platform flag for CI/CD platform selection. #3379
- Feature: Protect existing workflow files from accidental overwrites. #3407
- Feature: Add user messages to config ci. #3457
- Feature+Test: Add runtime-aware builder config and Config CI e2e tests. #3479
- Refactor: Move CI workflow generation from
cmd/ci to pkg/ci/github. #3572