Open Source CI/CD components for GitHub Actions

Open Source CI/CD components for GitHub Actions

GitHub Actions can orchestrate any workflow. In this talk I shared and showcase how to implement a CI/CD pipeline with open source GitHub action components. The audience may use the presented open source examples to build their own CI/CD pipelines based on open source GitHub action components.

4de70370869f561b5bb5a816d2be3198?s=128

Lothar Schulz

March 19, 2020
Tweet

Transcript

  1. Open Source CI/CD components for GitHub Actions FossAsia Summit Lothar

    Schulz 2020 03 19 pic: © moovel Open Source CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 @lothar_schulz
  2. pic: © moovel Open Source CI/CD components for GitHub Actions

    | FossAsia Summit | Lothar Schulz | 2020 03 19 @lothar_schulz
  3. pic: © moovel Open Source CI/CD components for GitHub Actions

    | FossAsia Summit | Lothar Schulz | 2020 03 19 @lothar_schulz
  4. Engineering Manager lotharschulz.info CI/CD Meetup Berlin github.com/lotharschulz speakerdeck.com/lothar @lothar_schulz lnkd.in/lotharschulz

    Me @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  5. GitHub Actions Workflow Automation @lothar_schulz Open Source CI/CD components for

    GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  6. Built-in CI/CD GitHub Actions @lothar_schulz Open Source CI/CD components for

    GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  7. What are GitHub Actions? With GitHub Actions, workflows and steps

    are just code in a repository, so you can create, share, reuse, and fork your software development practices. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 https://github.blog/2019-08-08-github-actions-now-supports-ci-cd/
  8. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19
  9. Open Source pic: © moovel @lothar_schulz Open Source CI/CD components

    for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  10. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19 github.com/actions
  11. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19 github.com/sdras/ awesome-actions #community-resources
  12. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19
  13. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19 github.com/ jessfraz/ shaking-finger-action
  14. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19 Open Source Projects using GitHub actions (list not complete) • https://github.com/gatsbyjs/gatsby/tree/master/.github/workflows • https://github.com/hakimel/reveal.js/blob/master/.github/workflows/js.yml • https://github.com/twbs/bootstrap/blob/master/.github/workflows/test.yml • https://github.com/microsoft/vscode/tree/master/.github/workflows • https://github.com/facebook/create-react-app/tree/master/.github/workflows • https://github.com/hakimel/reveal.js/blob/master/.github/workflows/js.yml • https://github.com/babel/babel/tree/master/.github/workflows • https://github.com/nodejs/node/tree/master/.github/workflows • https://github.com/microsoft/TypeScript/tree/master/.github/workflows
  15. How To's pic: © moovel @lothar_schulz Open Source CI/CD components

    for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  16. Matrix - Builds on Linux, macOS, Windows @lothar_schulz Open Source

    CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 strategy: fail-fast: false matrix: os: [macOS-10.14, ubuntu-18.04] goos: [linux, darwin] exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin runs-on: ${{ matrix.os }}
  17. Matrix - Excludes @lothar_schulz Open Source CI/CD components for GitHub

    Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 strategy: fail-fast: false matrix: os: [macOS-10.14, ubuntu-18.04] goos: [linux, darwin] exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin runs-on: ${{ matrix.os }} exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin
  18. Matrix - Includes & Excludes @lothar_schulz Open Source CI/CD components

    for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 strategy: fail-fast: false matrix: os: [macOS-10.14, ubuntu-18.04] goos: [linux, darwin] exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin runs-on: ${{ matrix.os }} exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin include: - os: macOS-10.14 goos: darwin - os: ubuntu-18.04 goos: linux
  19. Matrix - Includes & Excludes @lothar_schulz Open Source CI/CD components

    for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 strategy: fail-fast: false matrix: os: [macOS-10.14, ubuntu-18.04] goos: [linux, darwin] exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin runs-on: ${{ matrix.os }} exclude: - os: macOS-10.14 goos: linux - os: ubuntu-18.04 goos: darwin include: - os: macOS-10.14 goos: darwin - os: ubuntu-18.04 goos: linux !
  20. Jobs @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19 Jobs can run at the same time in parallel or be dependent on the status of a previous job and run sequentially. build-and-dockerhub-push-if-linux: needs: [benchmark, test]
  21. Conditionals @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19 if: matrix.os == 'ubuntu-18.04' env: DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} run: | d=$(date +%Y-%m-%d) tag=$d-${{ matrix.os }}-${{ github.sha }} docker build -t lotharschulz/hello-github-actions:$tag . docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD} docker push lotharschulz/hello-github-actions:$tag
  22. Matrix @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19
  23. Matrix @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19
  24. Matrix @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19
  25. Surprises @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19 test: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - uses: actions/setup-java@v1 with: java-version: 11 - uses: eskatos/gradle-command-action@v1 with: arguments: test - name: test the code
  26. Fix @lothar_schulz Open Source CI/CD components for GitHub Actions |

    FossAsia Summit | Lothar Schulz | 2020 03 19 test: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v1 - uses: actions/setup-java@v1 with: java-version: 11 - uses: eskatos/gradle-command-action@v1 with: arguments: test # - name: test the code
  27. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19
  28. Demo Code @lothar_schulz Open Source CI/CD components for GitHub Actions

    | FossAsia Summit | Lothar Schulz | 2020 03 19
  29. There is even more • Core concepts • Encrypted secrets

    • Self hosted runners @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  30. There is more • Contexts available on run time •

    Triggered by own events • Package manager and gh docker registry integrated @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19
  31. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19 pic: © moovel THANK YOU
  32. @lothar_schulz Open Source CI/CD components for GitHub Actions | FossAsia

    Summit | Lothar Schulz | 2020 03 19 pic: © moovel THANK YOU SLIDE DECK Open Source CI/CD components for GitHub Actions | FossAsia Summit | Lothar Schulz | 2020 03 19 @lothar_schulz pic: © moovel