techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 2 Tech Skills Transformations & Brent Laster Introduction to GitHub Actions
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 3 About me • R&D Director, DevOps • Global trainer – training (Git, Jenkins, Gradle, CI/CD, pipelines, Kubernetes, Helm, ArgoCD, operators) • Author - § OpenSource.com § Professional Git book § Jenkins 2 – Up and Running book § Continuous Integration vs. Continuous Delivery vs. Continuous Deployment mini-book on Safari techskillstransformations.com getskillsnow.com https://www.linkedin.com/in/brentlaster @BrentCLaster GitHub: brentlaster
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 4 Book – Professional Git • Extensive Git reference, explanations, and examples • First part for non-technical • Beginner and advanced reference • Hands-on labs
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 5 Jenkins 2 Book • Jenkins 2 – Up and Running • “It’s an ideal book for those who are new to CI/CD, as well as those who have been using Jenkins for many years. This book will help you discover and rediscover Jenkins.” By Kohsuke Kawaguchi, Creator of Jenkins
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 6 O’Reilly Training
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 7 What are GitHub Actions? • Way to create custom, automated workflows in GitHub • Executed based on repository operations • Building blocks - can be combined & shared • Used for usual SDLC tasks • Can be used for CI/CD as alternatives to other apps
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 8 What's interesting about it? • Direct integration with GitHub
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 9 What else is interesting about it? • Lots of events can trigger an action workflow - automate practically anything! on: project on: watch on: repository_dispatch on: delete on: check_run on: page_build on: scheduled on: pull_request on: public on: pull_request_review_comment on: pull_push on: fork https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 10 Types of triggers for events • single event - on: push • list of events - on: [push, pull_request] • specify activity types or configuration - on: push: branches: - main • scheduled events - on: scheduled: - cron: '30 5,15 * * *' • manual events - on: workflow-dispatch on: repository-dispatch [opened, deleted] • workflow reuse events - on: workflow-call (can be called from another workflow) • webhook events - on: issue_comment on: pull_request
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 11 How actions work? (events) • Events occur § Example: pull request triggers build for validation § Example: push for commit • Repository Dispatch Events § Endpoint that can be used to trigger webhook event § Can be used for activity that is not in GitHub § Can trigger a GitHub Actions workflow or GitHub App webhook • ref https://docs.github.com /en/rest/reference/repo s#create-a-repository- dispatch-event Event
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 12 How actions work (workflows) • Events trigger workflows workflow Event § Procedure to run automatically § Added to your repository § Composed of one+ jobs § Can be triggered/scheduled by event § Useful for doing CI/CD actions such as building, testing, packaging, etc.
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 13 How actions work (jobs, steps, actions) Workflows contain jobs § Set of steps § Workflow with multiple jobs runs them in parallel Jobs contain steps § A task that can execute commands in a job § Can be either » action » shell command workflow Job 1 Job 2 Event Step 1 Step 1 Step 2 Action Action Action Action § Independent commands § Combined into steps to form a job § Smallest unit in a workflow § Can be created or pulled in from the community § Only usable if included as a step
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 14 How actions work (runner) Runner • A server with GitHub Actions runner app on it • Can use runner provided by/hosted via GitHub or use your own • Runner listens for available jobs • Steps in a job execute on the same runner workflow Job 1 Job 2 Event Step 1 Step 1 Step 2 Action Action Action Runner 1 Action Runs Log results Runner 2 Action Runs Log results
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 15 How workflows are triggered 1. Event happens in repo 2. Resulting event has SHA and Git ref (branch) 3. .github/workflows dir in repo is searched for workflow files in same SHA or ref 4. workflow files for commit and ref are inspected 5. new workflow run triggered for any workflow with matching "on:" values
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 16 How actions work GitHub Repository .github workflows workflow1.yml Job 1 Step 1 Action Step 2 Action Job 2 Step 1 Action workflow2.yml Job 1 Step 1 Action Job 2 Step 1 Action Step 2 Action Runner 1 Action Runs Log results Runner 2 Action Runs Log results Event • Resides in .github/workflows • Can have multiple workflows
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 17 Editing Actions
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 18 Updating workflows with Pull Requests #1
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 19 Searching for a Public Action
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 20 Custom Actions • Can be created by you • Can result from customizing community actions • Can be put on Marketplace and shared • repository must be public • Can integrate with any public API • Can run directly on a machine or in Docker container • Can define inputs, outputs, and environment variables • Require metadata file • defines inputs, outputs, and entrypoint • must be named either action.yaml or action.yml • Should be tagged with a label and then pushed to GitHub • To use: • In file in .github/workflows/main.yml • In steps • "uses: <github path to action>@<label> $ <create GitHub repo> $ <clone repo> $ <create files> $ git add action.yml <other files> $ git commit -m "action files" $ git tag -a -m "first release of action" v1 $ git push --follow-tags on: [push] jobs: example_job: runs on: ubuntu-latest name: An example job steps: - name: Example step id: example_step uses: <repo name>/<action name>@<tag> ... .github/workflows/example.yml
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 21 Custom Action Types • Docker • Packages env with actions code • Env can include specific OS versions, config, tools, etc. • Well suited for specific env needs • Runs only on Linux runners with Docker installed • Slower due to cost of building and retrieving container • GitHub builds image from Dockerfile and runs comands in a new container based on image • Javascript • Run directly on runner for any of macOS, Linux, or Windows • Separates action from env • Fast than Docker • Needs to be pure JavaScript (no other binaries) • Can use binaries already on runner • Composite • Combines multiple workflow steps in one action Runner FROM <base> .... COPY <entry script> ENTRYPOINT <script> Dockerfile ... runs: using: 'docker' image: 'Dockerfile' args: .... action.yml + + Runner + + ... runs: using: 'node12' main: 'index.js' action.yml npm install @actions/core npm install @actions/github const core = require('@actions/core'); const github = require('@actions/github); try{ ... } catch (error) { ... } index.js Runner ... runs: using: 'composite' - run: echo ... - run: ${{ github.action.path }}/shell-script.sh action.yml + echo ... ... shell-script.sh
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 22 Actions Toolkit • Provides packages for more easily creating/working with actions • Functions in packages can be run in code as in core.setOutput('SELECTED_COLOR ', 'red'); or (in many cases) • run as workflow commands - name: Set selected color run: echo '::set-output name=SELECTED_COLOR::green'
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 23 Actions Toolkit packages • Collections of related functions • Can be imported into code for actions
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 24 Environment Variables for Actions • GitHub sets a set of default env vars for each run of an action • Can set custom variables in workflow file • Case-sensitive • Can be for step, job, or overall workflow jobs: my_job: env: LEVEL: admin steps: - auth: "Check if admin" if: {{ env.LEVEL == 'admin' }} run: echo "Detected admin user $USER_ID." env: USER_ID: abc123 • if in "run" key - reads env var from runner OS after job sent to runner • else use env "context" because variable must be sub'd during processing of workflow - before sent to runner Default Environment Variables GITHUB_WORKFLOW GITHUB_RUN_ID GITHUB_RUN_NUMBER GITHUB_JOB GITHUB_ACTION GITHUB_ACTION_PATH GITHUB_ACTIONS GITHUB_ACTOR GITHUB_REPOSITORY GITHUB_EVENT_NAME GITHUB_EVENT_PATH GITHUB_WORKSPACE GITHUB_SHA GITHUB_REF GITHUB_HEAD_REF GITHUB_BASE_REF GITHUB_SERVER_URL GITHUB_API_URL GITHUB_GRAPHQL_URL RUNNER_NAME RUNNER_OS RUNNER_TEMP RUNNER_TOOL_CACHE CI Ref: https://docs.github.com/en/actions/learn-github- actions/environment-variables
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 25 Viewing the Workflow Run history
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 26 Viewing a Specific Workflow Run
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 27 Drilling into logs • Click on workflow in list • Click on step • Step log is shown • Gear icon can be used for options - such as timestamps • Can also view raw logs
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 28 GitHub Actions Runner
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 29 GitHub Actions Virtual Environments • Virtual environments for GitHub actions hosted runners • VM images of Microsoft- hosted agents used for Azure Pipelines
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 30 GitHub-hosted vs Self-hosted Runners GitHub-hosted Self-hosted Definition Hosted by GitHub Any system/configuration you want to use Prereqs Running GitHub actions runner application GitHub actions self-hosted runner application Platforms Windows, Linux, MacOS Any that can be made to work Advantages Quicker and simpler Highly configurable Management/Ownership GitHub As defined Clean instance For every job execution Optional Cost Free minutes on GitHub plan with cost for overages Free to use with actions, but owner is responsible for any other cost Automatic updates For OS, installed packages, tools, and hosted runner application Only for self-hosted runner application Implementation Virtual Virtual or physical
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 31 GitHub Actions Storage - Artifacts • Actions allow you to persist data after job has completed - as artifacts • Artifact - file or collection of files produced during workflow run § build and test output § log files § binary files • Artifacts are uploaded during workflow run § can be shared between jobs in same workflow § visible in the UI • Default retention period is 90 days
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 32 What are the limits? • Job execution time - each job can run up to 6 hours of execution time § At 6 hours, job is terminated and fails to complete • Workflow run time - each workflow run limited to 72 hours § At limit, workflow run is cancelled • API requests - can execute up to 1000 API requests in an hour across all actions in a single repo § Past limit, additional API calls will fail • Concurrent jobs - number of concurrent jobs depends on plan § Past limit, additional jobs are queued GitHub plan Total concurrent jobs Maximum concurrent macOS jobs Free 20 5 Pro 40 5 Team 60 5 Enterprise 180 50
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 33 How much does it cost? (part 1) • Free for both public repos and self-hosted runners • For private repos, each GitHub account gets designated amount of free minutes and storage § above that, usage is controlled by spending limits § minutes reset every month, but not storage Product Storage Minutes (per month) GitHub Free 500 MB 2,000 GitHub Pro 1 GB 3,000 GitHub Free for organizations 500 MB 2,000 GitHub Team 2 GB 3,000 GitHub Enterprise Cloud 50 GB 50,000
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 34 How much does it cost? (part 2) • Total storage is Actions artifacts and GitHub Packages § GitHub Packages = platform for hosting and managing packages, such as containers or dependencies • Storage usage is calculated for each month based on hourly usage during the month • Per-minute rates • If jobs run on Windows or macOS on runners hosted by GitHub, multiplier comes into play Operating system Minute multiplier Linux 1 macOS 10 Windows 2 Operating system Per-minute rate (USD) Linux $0.008 macOS $0.08 Windows $0.016
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 35 Upcoming Training on GitHub Actions
techupskills.com | techskillstransformations.com © 2021 Brent C. Laster & @techupskills 36 That’s all - thanks! techskillstransformations.com getskillsnow.com

Introduction to GitHub Actions - How to easily automate and integrate with GitHub

  • 1.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 2 Tech Skills Transformations & Brent Laster Introduction to GitHub Actions
  • 2.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 3 About me • R&D Director, DevOps • Global trainer – training (Git, Jenkins, Gradle, CI/CD, pipelines, Kubernetes, Helm, ArgoCD, operators) • Author - § OpenSource.com § Professional Git book § Jenkins 2 – Up and Running book § Continuous Integration vs. Continuous Delivery vs. Continuous Deployment mini-book on Safari techskillstransformations.com getskillsnow.com https://www.linkedin.com/in/brentlaster @BrentCLaster GitHub: brentlaster
  • 3.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 4 Book – Professional Git • Extensive Git reference, explanations, and examples • First part for non-technical • Beginner and advanced reference • Hands-on labs
  • 4.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 5 Jenkins 2 Book • Jenkins 2 – Up and Running • “It’s an ideal book for those who are new to CI/CD, as well as those who have been using Jenkins for many years. This book will help you discover and rediscover Jenkins.” By Kohsuke Kawaguchi, Creator of Jenkins
  • 5.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 6 O’Reilly Training
  • 6.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 7 What are GitHub Actions? • Way to create custom, automated workflows in GitHub • Executed based on repository operations • Building blocks - can be combined & shared • Used for usual SDLC tasks • Can be used for CI/CD as alternatives to other apps
  • 7.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 8 What's interesting about it? • Direct integration with GitHub
  • 8.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 9 What else is interesting about it? • Lots of events can trigger an action workflow - automate practically anything! on: project on: watch on: repository_dispatch on: delete on: check_run on: page_build on: scheduled on: pull_request on: public on: pull_request_review_comment on: pull_push on: fork https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
  • 9.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 10 Types of triggers for events • single event - on: push • list of events - on: [push, pull_request] • specify activity types or configuration - on: push: branches: - main • scheduled events - on: scheduled: - cron: '30 5,15 * * *' • manual events - on: workflow-dispatch on: repository-dispatch [opened, deleted] • workflow reuse events - on: workflow-call (can be called from another workflow) • webhook events - on: issue_comment on: pull_request
  • 10.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 11 How actions work? (events) • Events occur § Example: pull request triggers build for validation § Example: push for commit • Repository Dispatch Events § Endpoint that can be used to trigger webhook event § Can be used for activity that is not in GitHub § Can trigger a GitHub Actions workflow or GitHub App webhook • ref https://docs.github.com /en/rest/reference/repo s#create-a-repository- dispatch-event Event
  • 11.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 12 How actions work (workflows) • Events trigger workflows workflow Event § Procedure to run automatically § Added to your repository § Composed of one+ jobs § Can be triggered/scheduled by event § Useful for doing CI/CD actions such as building, testing, packaging, etc.
  • 12.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 13 How actions work (jobs, steps, actions) Workflows contain jobs § Set of steps § Workflow with multiple jobs runs them in parallel Jobs contain steps § A task that can execute commands in a job § Can be either » action » shell command workflow Job 1 Job 2 Event Step 1 Step 1 Step 2 Action Action Action Action § Independent commands § Combined into steps to form a job § Smallest unit in a workflow § Can be created or pulled in from the community § Only usable if included as a step
  • 13.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 14 How actions work (runner) Runner • A server with GitHub Actions runner app on it • Can use runner provided by/hosted via GitHub or use your own • Runner listens for available jobs • Steps in a job execute on the same runner workflow Job 1 Job 2 Event Step 1 Step 1 Step 2 Action Action Action Runner 1 Action Runs Log results Runner 2 Action Runs Log results
  • 14.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 15 How workflows are triggered 1. Event happens in repo 2. Resulting event has SHA and Git ref (branch) 3. .github/workflows dir in repo is searched for workflow files in same SHA or ref 4. workflow files for commit and ref are inspected 5. new workflow run triggered for any workflow with matching "on:" values
  • 15.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 16 How actions work GitHub Repository .github workflows workflow1.yml Job 1 Step 1 Action Step 2 Action Job 2 Step 1 Action workflow2.yml Job 1 Step 1 Action Job 2 Step 1 Action Step 2 Action Runner 1 Action Runs Log results Runner 2 Action Runs Log results Event • Resides in .github/workflows • Can have multiple workflows
  • 16.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 17 Editing Actions
  • 17.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 18 Updating workflows with Pull Requests #1
  • 18.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 19 Searching for a Public Action
  • 19.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 20 Custom Actions • Can be created by you • Can result from customizing community actions • Can be put on Marketplace and shared • repository must be public • Can integrate with any public API • Can run directly on a machine or in Docker container • Can define inputs, outputs, and environment variables • Require metadata file • defines inputs, outputs, and entrypoint • must be named either action.yaml or action.yml • Should be tagged with a label and then pushed to GitHub • To use: • In file in .github/workflows/main.yml • In steps • "uses: <github path to action>@<label> $ <create GitHub repo> $ <clone repo> $ <create files> $ git add action.yml <other files> $ git commit -m "action files" $ git tag -a -m "first release of action" v1 $ git push --follow-tags on: [push] jobs: example_job: runs on: ubuntu-latest name: An example job steps: - name: Example step id: example_step uses: <repo name>/<action name>@<tag> ... .github/workflows/example.yml
  • 20.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 21 Custom Action Types • Docker • Packages env with actions code • Env can include specific OS versions, config, tools, etc. • Well suited for specific env needs • Runs only on Linux runners with Docker installed • Slower due to cost of building and retrieving container • GitHub builds image from Dockerfile and runs comands in a new container based on image • Javascript • Run directly on runner for any of macOS, Linux, or Windows • Separates action from env • Fast than Docker • Needs to be pure JavaScript (no other binaries) • Can use binaries already on runner • Composite • Combines multiple workflow steps in one action Runner FROM <base> .... COPY <entry script> ENTRYPOINT <script> Dockerfile ... runs: using: 'docker' image: 'Dockerfile' args: .... action.yml + + Runner + + ... runs: using: 'node12' main: 'index.js' action.yml npm install @actions/core npm install @actions/github const core = require('@actions/core'); const github = require('@actions/github); try{ ... } catch (error) { ... } index.js Runner ... runs: using: 'composite' - run: echo ... - run: ${{ github.action.path }}/shell-script.sh action.yml + echo ... ... shell-script.sh
  • 21.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 22 Actions Toolkit • Provides packages for more easily creating/working with actions • Functions in packages can be run in code as in core.setOutput('SELECTED_COLOR ', 'red'); or (in many cases) • run as workflow commands - name: Set selected color run: echo '::set-output name=SELECTED_COLOR::green'
  • 22.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 23 Actions Toolkit packages • Collections of related functions • Can be imported into code for actions
  • 23.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 24 Environment Variables for Actions • GitHub sets a set of default env vars for each run of an action • Can set custom variables in workflow file • Case-sensitive • Can be for step, job, or overall workflow jobs: my_job: env: LEVEL: admin steps: - auth: "Check if admin" if: {{ env.LEVEL == 'admin' }} run: echo "Detected admin user $USER_ID." env: USER_ID: abc123 • if in "run" key - reads env var from runner OS after job sent to runner • else use env "context" because variable must be sub'd during processing of workflow - before sent to runner Default Environment Variables GITHUB_WORKFLOW GITHUB_RUN_ID GITHUB_RUN_NUMBER GITHUB_JOB GITHUB_ACTION GITHUB_ACTION_PATH GITHUB_ACTIONS GITHUB_ACTOR GITHUB_REPOSITORY GITHUB_EVENT_NAME GITHUB_EVENT_PATH GITHUB_WORKSPACE GITHUB_SHA GITHUB_REF GITHUB_HEAD_REF GITHUB_BASE_REF GITHUB_SERVER_URL GITHUB_API_URL GITHUB_GRAPHQL_URL RUNNER_NAME RUNNER_OS RUNNER_TEMP RUNNER_TOOL_CACHE CI Ref: https://docs.github.com/en/actions/learn-github- actions/environment-variables
  • 24.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 25 Viewing the Workflow Run history
  • 25.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 26 Viewing a Specific Workflow Run
  • 26.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 27 Drilling into logs • Click on workflow in list • Click on step • Step log is shown • Gear icon can be used for options - such as timestamps • Can also view raw logs
  • 27.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 28 GitHub Actions Runner
  • 28.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 29 GitHub Actions Virtual Environments • Virtual environments for GitHub actions hosted runners • VM images of Microsoft- hosted agents used for Azure Pipelines
  • 29.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 30 GitHub-hosted vs Self-hosted Runners GitHub-hosted Self-hosted Definition Hosted by GitHub Any system/configuration you want to use Prereqs Running GitHub actions runner application GitHub actions self-hosted runner application Platforms Windows, Linux, MacOS Any that can be made to work Advantages Quicker and simpler Highly configurable Management/Ownership GitHub As defined Clean instance For every job execution Optional Cost Free minutes on GitHub plan with cost for overages Free to use with actions, but owner is responsible for any other cost Automatic updates For OS, installed packages, tools, and hosted runner application Only for self-hosted runner application Implementation Virtual Virtual or physical
  • 30.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 31 GitHub Actions Storage - Artifacts • Actions allow you to persist data after job has completed - as artifacts • Artifact - file or collection of files produced during workflow run § build and test output § log files § binary files • Artifacts are uploaded during workflow run § can be shared between jobs in same workflow § visible in the UI • Default retention period is 90 days
  • 31.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 32 What are the limits? • Job execution time - each job can run up to 6 hours of execution time § At 6 hours, job is terminated and fails to complete • Workflow run time - each workflow run limited to 72 hours § At limit, workflow run is cancelled • API requests - can execute up to 1000 API requests in an hour across all actions in a single repo § Past limit, additional API calls will fail • Concurrent jobs - number of concurrent jobs depends on plan § Past limit, additional jobs are queued GitHub plan Total concurrent jobs Maximum concurrent macOS jobs Free 20 5 Pro 40 5 Team 60 5 Enterprise 180 50
  • 32.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 33 How much does it cost? (part 1) • Free for both public repos and self-hosted runners • For private repos, each GitHub account gets designated amount of free minutes and storage § above that, usage is controlled by spending limits § minutes reset every month, but not storage Product Storage Minutes (per month) GitHub Free 500 MB 2,000 GitHub Pro 1 GB 3,000 GitHub Free for organizations 500 MB 2,000 GitHub Team 2 GB 3,000 GitHub Enterprise Cloud 50 GB 50,000
  • 33.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 34 How much does it cost? (part 2) • Total storage is Actions artifacts and GitHub Packages § GitHub Packages = platform for hosting and managing packages, such as containers or dependencies • Storage usage is calculated for each month based on hourly usage during the month • Per-minute rates • If jobs run on Windows or macOS on runners hosted by GitHub, multiplier comes into play Operating system Minute multiplier Linux 1 macOS 10 Windows 2 Operating system Per-minute rate (USD) Linux $0.008 macOS $0.08 Windows $0.016
  • 34.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 35 Upcoming Training on GitHub Actions
  • 35.
    techupskills.com | techskillstransformations.com ©2021 Brent C. Laster & @techupskills 36 That’s all - thanks! techskillstransformations.com getskillsnow.com