Skip to content

docs: update github actions workflow example - #2195

Merged
gerhard merged 1 commit into
dagger:mainfrom
crazy-max:update-gha-doc
Apr 14, 2022
Merged

gerhard merged 1 commit into
dagger:mainfrom
crazy-max:update-gha-doc

Conversation

@crazy-max

Copy link
Copy Markdown
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 [email protected]

Comment on lines 29 to 31

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@crazy-max crazy-max Apr 14, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

@gerhard

gerhard commented Apr 14, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@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

@gerhard gerhard left a comment

Copy link
Copy Markdown
Contributor

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
@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 <[email protected]>
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.

2 participants