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

docs: update github actions workflow example #2195

Merged
merged 1 commit into from Apr 14, 2022

Conversation

crazy-max
Copy link
Contributor

With the upcoming release of our GitHub Actions, args has been replaced with cmds input allowing multi dagger commands within a single step.

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

Comment on lines +29 to +31
cmds: |
project update
do deploy
Copy link
Member

Choose a reason for hiding this comment

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

I really like this pattern.

What happens when project update fails? Before this, the step would make it clear why it failed, but now I don't know.

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 project update fails then it will exit immediately and don't process the next command

Copy link
Contributor Author

@crazy-max crazy-max Apr 14, 2022

Choose a reason for hiding this comment

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

Here is what it looks like with collapsible groups to split logs per cmd: https://github.com/dagger/dagger-for-github/runs/6022757575?check_suite_focus=true#step:3:12

Copy link
Member

Choose a reason for hiding this comment

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

That sounds good! How does it look when project update fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

@gerhard
Copy link
Member

gerhard commented Apr 14, 2022

I like where this is going! It must wait for #2172 however. There are a few changes coming, and updating the actual workflow is just as important: https://github.com/dagger/dagger/pull/2172/files#diff-472b1b8ec4b92806685394e7aad78734b8ca06feaa04491d31adfd51e5ebba95

@crazy-max
Copy link
Contributor Author

I like where this is going! It must wait for #2172 however. There are a few changes coming, and updating the actual workflow is just as important: https://github.com/dagger/dagger/pull/2172/files#diff-472b1b8ec4b92806685394e7aad78734b8ca06feaa04491d31adfd51e5ebba95

Looking at https://github.com/dagger/dagger/blob/main/.github/workflows/todoapp.yml and my comment in dagger/dagger-for-github#35 (comment), it could be done with only one step:

name: todoapp

on:
  push:
    branches:
      - main
    paths:
      - '.github/workflows/todoapp.yml'
      - 'pkg/universe.dagger.io/examples/todoapp/**'

env:
  # This needs to be unique across all of Netlify
  APP_NAME: todoapp-dagger-europa
  NETLIFY_TEAM: blocklayer
  # https://app.netlify.com/user/applications/personal
  NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
  DAGGER_LOG_FORMAT: plain

jobs:
  dagger:
    name: "Deploy todoapp to Netlify"
    runs-on: ubuntu-latest
    steps:
      - name: "Clone repository"
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Dagger
        uses: dagger/dagger-for-github@v2
        with:
          version: ${{ github.repositoryUrl }}#${{ github.ref }}
          cmds: do deploy
          workdir: pkg/universe.dagger.io/examples/todoapp

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max marked this pull request as ready for review April 14, 2022 15:54
@crazy-max crazy-max requested a review from a team as a code owner April 14, 2022 15:54
Copy link
Member

@gerhard gerhard left a comment

Choose a reason for hiding this comment

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

🚀

@gerhard gerhard merged commit 48fefa4 into dagger:main Apr 14, 2022
gerhard added a commit to gerhard/dagger that referenced this pull request Apr 14, 2022
Thanks to a great community contribution, we are improving the GitHub
Actions integration further. We should probably do the same for the
GitLab integration doc as a follow-up to this.

Follow-up to dagger#1962
Uses improvements from dagger#2195

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
gerhard added a commit to gerhard/dagger that referenced this pull request Apr 14, 2022
Thanks to a great community contribution, we are improving the GitHub
Actions integration further. We should probably do the same for the
GitLab integration doc as a follow-up to this.

Follow-up to dagger#1962
Uses improvements from dagger#2195

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
@crazy-max crazy-max deleted the update-gha-doc branch April 14, 2022 19:42
ivorscott pushed a commit to ivorscott/dagger that referenced this pull request Apr 18, 2022
Thanks to a great community contribution, we are improving the GitHub
Actions integration further. We should probably do the same for the
GitLab integration doc as a follow-up to this.

Follow-up to dagger#1962
Uses improvements from dagger#2195

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
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.

None yet

2 participants