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

Dagger for GitHub action for Dagger v0.9.3 #98

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

jpadams
Copy link
Contributor

@jpadams jpadams commented Nov 13, 2023

We'll release this as v5.0.0 , v5
https://docs.github.com/en/actions/creating-actions/about-custom-actions

Works as expected here for dagger call and dagger run cases:
https://github.com/jpadams/test-new-action/actions/runs/6859800772/job/18652631258

DX is basic, but pretty good for both dagger run and dagger call.
https://github.com/jpadams/test-new-action/blob/main/.github/workflows/run-and-call.yml#L27-L41

    - name: dagger run
      uses: dagger/dagger-for-github@dagger-for-gh-action-v0.9.3
      with:
        workdir: db-service
        verb: run
        args: node build.js
        cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
        version: "0.9.3"
    - name: dagger call
      uses: dagger/dagger-for-github@dagger-for-gh-action-v0.9.3
      with:
        verb: call 
        module: github.com/shykes/daggerverse/hello
        args: with-greeting --greeting Hola with-name --name Jeremy message
        cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}

Updated README.md:
https://github.com/dagger/dagger-for-github/blob/ea5581fc7d79ae81db8c18029cbc76d3f45cf1ea/README.md

@jpadams jpadams changed the title Dagger for gh action v0.9.3 Dagger for GitHub action v0.9.3 Nov 13, 2023
@jpadams jpadams changed the title Dagger for GitHub action v0.9.3 Dagger for GitHub action for Dagger v0.9.3 Nov 13, 2023
jpadams and others added 2 commits November 13, 2023 15:07
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
Signed-off-by: Kyle Penfound <kyle@dagger.io>
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
Co-authored-by: Jeremy Adams <jeremy@dagger.io>
Copy link

@shykes shykes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this as a way to use Zenith.

One important question: can this also used as a wrapper to dagger run in pre-Zenith CLI? And, should it?

@jpadams

This comment was marked as resolved.

@shykes
Copy link

shykes commented Nov 14, 2023

Should be an easy fix to accommodate dagger run. Can't think of why we wouldn't want that for now.

Yeah, we need to make sure the UX is smooth, but making this dual usage would be great.

@jpadams
Copy link
Contributor Author

jpadams commented Nov 14, 2023

Should be an easy fix to accommodate dagger run. Can't think of why we wouldn't want that for now.

Yeah, we need to make sure the UX is smooth, but making this dual usage would be great.

Pretty good for dagger run and dagger call at this point.
Brings CLI-feel into GHA:
https://github.com/jpadams/test-new-action/blob/main/.github/workflows/run-and-call.yml#L27-L41

@jpadams jpadams requested a review from shykes November 14, 2023 18:28
action.yml Outdated
DAGGER_VERSION=${{ inputs.version }} sh 2>/dev/null; }
shell: bash

- run: if ! [ -d ./.git ]; then git clone -b ${GITHUB_REF_NAME} --no-checkout https://github.com/${GITHUB_REPOSITORY} .; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this so we can get the git metadata for cloud?

Makes sense for now if so, but one of the cool benefits is that the git checkout should be optional now. With some updates to how we get the git metadata (i.e. optionally parse from env rather than the local .git) we could achieve that I think. Obviously not a blocker here, just checking that's the reason we included this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try it without this and see if it's really needed for Dagger Cloud.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remove the git stuff
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a run that still has the git script
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't see any reason to keep it. It's outta here!

Signed-off-by: Jeremy Adams <jeremy@dagger.io>
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
@jpadams jpadams merged commit 6a288cf into main Nov 14, 2023
2 checks passed
@jpadams jpadams deleted the dagger-for-gh-action-v0.9.3 branch November 14, 2023 19:31
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.

4 participants