Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build docker images on PR #2058

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

build docker images on PR #2058

wants to merge 15 commits into from

Conversation

kradalby
Copy link
Collaborator

Take 2, not from fork, supersedes #2053

Sometimes we want people to test features in PRs and
not everyone is used to using git, build go and docker.

This commit builds docker containers and pushes them to
GHCR (not dockerhub) for testing on pushes to branches
that has open pull requests to main using Ko.
This is configured to mimic the debug images produced
by goreleaser.

Sometimes we want people to test features in PRs and
not everyone is used to using git, build go and docker.

This commit builds docker containers and pushes them to
GHCR (not dockerhub) for testing on pushes to branches
that has open pull requests to main using Ko.
This is configured to mimic the debug images produced
by goreleaser.

Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby
Copy link
Collaborator Author

Looks like this isnt possible,

pull_request does not have secrets access, so cannot push.

pull_request_target has secret access, but runs on the base branch, not the new commits, so the changes would not be reflected.

@kradalby kradalby marked this pull request as draft August 14, 2024 07:38
@chriswiggins
Copy link

@kradalby this should work, You need to make sure that the permissions are set for the GITHUB_TOKEN so that it is allowed to write to the package registry:

permissions:
  pull-requests: write
  packages: write

You also need to authenticate to the registry first:

        name: Login to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

@masterwishx
Copy link

Collaborator

last beta4 builded ...beta.4 instead of ...beta4

@kradalby
Copy link
Collaborator Author

kradalby commented Sep 9, 2024

@masterwishx this is in response to #1923

@kradalby
Copy link
Collaborator Author

kradalby commented Sep 9, 2024

@chriswiggins, I think I could not get it to work for PRs at all? and from what I read in the gh docs secrets are not available, but I might have the motivation to fight and try this again at another time...

@masterwishx
Copy link

@masterwishx this is in response to #1923

got it, but now have next , not that a big problem :

image

@kradalby
Copy link
Collaborator Author

kradalby commented Sep 9, 2024

@masterwishx oh dear, I'll post it to the #1923 issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants