Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GitHub Actions 101

GitHub Actions 101

This slide deck contains information at a 101 high-level overview of GitHub Actions.

Thomas Hughes

March 18, 2020
Tweet

More Decks by Thomas Hughes

Other Decks in Technology

Transcript

  1. Agenda • What are GitHub Actions as a product? •

    What are the components of a GitHub action? • What are repository secrets? • What are self-hosted runners? • GitHub Actions API • Writing a basic GitHub action together from "scratch" • How to post your new action to the marketplace • Future feature plans (subject to change) • Q&A
  2. What are GitHub Actions? • Custom workflows triggered on any

    GitHub event • World class CI/CD primitives • Matrix builds • Live, streaming logs • Built in secret store • Familiar YAML syntax • Linux, macOS, and Windows hosted runners • Self hosted runners • GitHub Enterprise Server support coming soon Events Workflows Actions Trigger Use
  3. Workflows Workflows let you codify useful processes to your liking.

    They belong in YAML files in a special directory in your repository, .github/workflows. Examples • Organizational: Welcoming new contributors • Legal: Ensuring license uniformity • Application: Testing across multiple operating systems Events Workflows Actions Trigger Use
  4. Events Workflows are triggered on events: • push, pull_request, public,

    etc. • schedule • repository_dispatch (outside systems) Events Workflows Actions Trigger Use
  5. Actions Actions are reusable units of code made available to

    your workflows. GitHub runs them in a Node.js runtime or in Docker containers and are referenced from workflows as uses: owner/repo@ref. Examples • stale • javascript-action • Lots more on GitHub Marketplace Events Workflows Actions Trigger Use
  6. What about self-hosted runners? • Open Source: https://github.com/actions/runner • Create

    your own custom runner w/ whatever customizations you need (more hardware, OS, on-prem, in cloud, etc) • Free to use with GitHub Actions, but you're responsible for cost of maintaining your runner machine(s) • GitHub recommends AGAINST using self-hosted runners for public repos
  7. GitHub Actions API • Endpoints available to view anything from

    the Actions UI • Artifacts, Workflows, Job information, Run information • Secrets API to manage and update your secret stores • Org-level Secrets coming with an API as well! • API Documentation: https://developer.github.com/v3/ actions/
  8. Actions: which kind? TLDR; Write in the language and environment

    that makes sense for you. JavaScript actions are faster, runtime is more versatile, and offer a better user experience. Events Workflows Actions Trigger Use JavaScript action Container action Virtual environment Linux, MacOS, Windows Linux Language Anything that compiles to JavaScript Any Speed ++ + User experience ++ +
  9. Best practices • Chainable actions versus monolithic • Versioning your

    action • Documentation: README, CONTRIBUTING, etc • Test Coverage • Proper action.yml metadata • Post to the marketplace!
  10. Q&A