func icon indicating copy to clipboard operation
func copied to clipboard

Document and reference Github Actions for building and deploying func projects

Open salaboy opened this issue 3 years ago • 12 comments
trafficstars

Building and Deploying functions can be performed purely by Github actions, without the need for any other tools. This process needs to be documented and explained in the docs for people to be able to setup their repositories with these actions.

salaboy avatar Apr 20 '22 07:04 salaboy

@thomasvitale is already working on implementing some GitHub actions workflows here:

https://github.com/ThomasVitale/kn-func-build

salaboy avatar Apr 20 '22 07:04 salaboy

The work on the GitHub action is still in progress. In the meantime, this is an example of building and pushing an image using the func CLI explicitly in a GitHub Actions workflow: https://github.com/ThomasVitale/devoxxuk-question-1/blob/main/.github/workflows/commit-stage.yml#L72

ThomasVitale avatar May 16 '22 17:05 ThomasVitale

@ThomasVitale I am really interested in your idea of creating a native action with Typescript, can you paste here some links to some references about what you had in mind? If we start with something simple for just building and publishing the function artifacts to ghcr it will be great.

salaboy avatar Jun 25 '22 07:06 salaboy

@salaboy After a few experiments, I came up with a possible solution for having support for func in GitHub Actions. And the TypeScript option gives the most flexibility there.

A first action would be something like func-setup-action for installing the func CLI and make it available on the current runner. By default, it would install the latest version, but an optional parameter could be used to install a specific version. After that, it would be possible to use the func CLI directly.

steps:
    - uses: knative/func-setup-action@v1
    - run: func version

For convenience, it could be useful to have some specialised actions for some of the operations provided by func, like func-build-action and func-deploy-action.

steps:
    - uses: knative/func-setup-action@v1
    - uses: knative/func-build-action@v1
       with:
           path: .
           publish: true
           name: spring-boot-func
           version: 3.9.4

The prerequisite for using any of those actions would be to have the runner already authenticated with a container registry, for example using the docker/login-action or redhat-actions/podman-login.

How does that sound?

ThomasVitale avatar Jun 25 '22 12:06 ThomasVitale

I'm interested in the issue. Currently, I install the CLI using curl.

pmbanugo avatar Aug 02 '22 18:08 pmbanugo

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jan 03 '23 01:01 github-actions[bot]

/remove-lifecycle stale

zroubalik avatar Jan 03 '23 08:01 zroubalik

Minor updates to @ThomasVitale in this PR: https://github.com/ThomasVitale/kn-func-build/pull/1 which works to deploy to gcr.io, docker.io and other cloud repos.

qwpto avatar Mar 07 '23 14:03 qwpto

We should discuss this in our weekly

salaboy avatar Mar 07 '23 14:03 salaboy

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Aug 16 '23 01:08 github-actions[bot]

/remove-lifecycle stale

lance avatar Aug 16 '23 01:08 lance

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Mar 06 '24 01:03 github-actions[bot]

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jun 21 '24 01:06 github-actions[bot]