SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Developer relations & communities
Cloud & DevOps
Open Source
Books, acting, anchoring, filmmaking
@mvkaran
World class CI/CD
Fully integrated with GitHub
Respond to any GitHub event
Community-powered workflows
Any platform, any language, any cloud
Matrix builds
Streaming, searchable, linkable logs
Built-in secret store
Easy to write, easy to share
Actions are reusable
components
● Live in independent repositories
○ Public repositories for now
○ Official list: https://github/actions
● Written in JavaScript (node12)
○ May use GitHub Actions Toolkit JS for
command line argument parsing, passing
parameters, interacting with the GitHub
API
● Or Docker
○ Similar to beta 1 actions, but with updated
syntax & argument passing
○ Or point to existing actions published to
Docker Hub
1
2
Workflows
Workflow files glue together existing actions
● Listen for particular triggers
● Then run shell scripts
● Or pre-existing actions
● Actions run in VMs (Linux, Win, Mac)
○ Or Docker on Linux VM
1
2
3
Stuff to keep in mind
re Workflows
● Events kick off the workflow
● Jobs run each in their own VM
○ In parallel (unless the
workflow says otherwise)
○ Job specifies the VM
Linux/Windows/MacOS
● Steps run in the same VM
○ Share filesystem
● Logs are searchable, link to
individual lines
○ Artifacts can be saved
A Java + Maven
basic CI workflow
● A single job, with 5 steps
● Runs directly on the VM
○ Ubuntu in this case
● Actions are composable
○ Checkout is separate
○ Setup for most languages in
github.com/actions
○ Maven run by shell
○ Artifact uploaded separately
1
2
3
4
Event triggers
`on: push`
Complete reference in the docs:
https://help.github.com/en/articles/e
vents-that-trigger-workflows
Listen for multiple events:
on: [push, pull_request]
Qualify these as needed:
on:
create:
ref_type: tag
Or for a branch:
on:
push:
branches:
- master
paths:
- 'test/*'
Schedule with cron synax:
on:
schedule:
- cron: '*/15 * * * *'
Steps: Where the
magic happens
Complete reference in the docs:
help.github.com/en/articles/configuri
ng-a-workflow
Run other actions:
steps:
- uses: actions/checkout@v1
with:
ref: staging-branch
Or command line scripts:
- name: Build with Maven
run: mvn package -DskipTests
Even multi-line scripts:
- name: Test with Maven
run: |
mvn test
echo Testing separately
Getting Started with Actions
https://github.com/marketplace
https://github.com/marketplace
Live Demo
CI/CD powered by Actions
Example application
● Open MCT (Open Mission Control
Technologies) is a mission control
framework for visualization of data
on desktop and mobile devices.
● NodeJS app
● Open source under Apache 2.0
License
● Dockerized it for this demo
● github.com/nasa/openmct-tutorial
My Actions Pro-Tips
# Trigger workflows externally
on: repository_dispatch
# POST /repos/:owner/:repo/dispatches
{
"event_type": "custom-name",
"client_payload": {
"custom_message": “Hello world!”
}
}
# Scheduled workflows with CRON syntax
on:
schedule:
# * is a special character in YAML
# so you have to quote this string
- cron: ’*/15 * * * *’
# Resolve dependencies across jobs
jobs:
Job1:
# ...
Job2:
needs: Job1
# ...
Job3:
needs: [Job1, Job2]
# ...
# Run a job based on previous step exit status
jobs:
MyJob:
Steps:
# ...
- name: Trigger alert
if: failure()
# if: success()
# if: canceled()
# if: always()
# Use the built-in Secrets store
jobs:
MyJob:
steps:
# ...
- uses: digitalocean/action-doctl@v2
with:
token:
${{ secrets.DO_ACCESS_TOKEN }}
https://help.github.com/en/actions/
https://lab.github.com
Resources
http://kmv.im/deploy2020
Run on your own hardware for free
with self-hosted runners
Free for public repositories
Try Actions Today
github.com/features/actions
Thank you! Let’s connect...
Aug 2020
MV Karan
GitHub & Twitter: @mvkaran
LinkedIn: /in/mvkaran
Deploying to DigitalOcean With GitHub Actions

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Tugbot - Testing Framework for Docker Containers
Tugbot - Testing Framework for Docker ContainersTugbot - Testing Framework for Docker Containers
Tugbot - Testing Framework for Docker Containers
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Docker e git lab
Docker e git labDocker e git lab
Docker e git lab
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using Surf
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
CI CD WORKFLOW
 
From Java Monolith to k8s with CI/CD
From Java Monolith to k8s with CI/CD From Java Monolith to k8s with CI/CD
From Java Monolith to k8s with CI/CD
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
 
The Self-Service Developer - GOTOCon CPH
The Self-Service Developer - GOTOCon CPHThe Self-Service Developer - GOTOCon CPH
The Self-Service Developer - GOTOCon CPH
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
Breaking bad habits with GitLab CI
Breaking bad habits with GitLab CIBreaking bad habits with GitLab CI
Breaking bad habits with GitLab CI
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIContinuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CI
 
Introduction to go, and why it's awesome
Introduction to go, and why it's awesomeIntroduction to go, and why it's awesome
Introduction to go, and why it's awesome
 
Jenkins Shared Libraries
Jenkins Shared LibrariesJenkins Shared Libraries
Jenkins Shared Libraries
 
Successful DevOps implementation for small teams a true story
Successful DevOps implementation for small teams  a true storySuccessful DevOps implementation for small teams  a true story
Successful DevOps implementation for small teams a true story
 
An introduction to Atlassian Bitbucket Pipelines
An introduction to Atlassian Bitbucket PipelinesAn introduction to Atlassian Bitbucket Pipelines
An introduction to Atlassian Bitbucket Pipelines
 
Breaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CIBreaking Bad Habits with GitLab CI
Breaking Bad Habits with GitLab CI
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoin
 

Ähnlich wie Deploying to DigitalOcean With GitHub Actions

Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
Matthias Luebken
 

Ähnlich wie Deploying to DigitalOcean With GitHub Actions (20)

DWX 2022 - DevSecOps mit GitHub
DWX 2022 - DevSecOps mit GitHubDWX 2022 - DevSecOps mit GitHub
DWX 2022 - DevSecOps mit GitHub
 
Introduction to Github action Presentation
Introduction to Github action PresentationIntroduction to Github action Presentation
Introduction to Github action Presentation
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
 
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...Introduction to GitHub Actions - How to easily automate and integrate with Gi...
Introduction to GitHub Actions - How to easily automate and integrate with Gi...
 
Fullstack workshop
Fullstack workshopFullstack workshop
Fullstack workshop
 
Tutorial contributing to nf-core
Tutorial contributing to nf-coreTutorial contributing to nf-core
Tutorial contributing to nf-core
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
 
How to build a tool for operating Flink on Kubernetes
How to build a tool for operating Flink on KubernetesHow to build a tool for operating Flink on Kubernetes
How to build a tool for operating Flink on Kubernetes
 
Jenkins Pipelines
Jenkins PipelinesJenkins Pipelines
Jenkins Pipelines
 
Github in Action
Github in ActionGithub in Action
Github in Action
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Angular based enterprise level frontend architecture
Angular based enterprise level frontend architectureAngular based enterprise level frontend architecture
Angular based enterprise level frontend architecture
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHub
 
Building an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache GroovyBuilding an Extensible, Resumable DSL on Top of Apache Groovy
Building an Extensible, Resumable DSL on Top of Apache Groovy
 
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
Devoops: DoJ Annual Cybersecurity Training Symposium Edition 2015
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
 
Devoxx 2014 [incomplete] summary
Devoxx 2014 [incomplete] summaryDevoxx 2014 [incomplete] summary
Devoxx 2014 [incomplete] summary
 

Mehr von DigitalOcean

Kubernetes for Beginners
Kubernetes for BeginnersKubernetes for Beginners
Kubernetes for Beginners
DigitalOcean
 
Secrets to Building & Scaling SRE Teams
Secrets to Building & Scaling SRE TeamsSecrets to Building & Scaling SRE Teams
Secrets to Building & Scaling SRE Teams
DigitalOcean
 

Mehr von DigitalOcean (20)

Build Cloud Native Apps With DigitalOcean Kubernetes
Build Cloud Native Apps With DigitalOcean KubernetesBuild Cloud Native Apps With DigitalOcean Kubernetes
Build Cloud Native Apps With DigitalOcean Kubernetes
 
Benefits of Managed Databases
Benefits of Managed DatabasesBenefits of Managed Databases
Benefits of Managed Databases
 
Increase App Confidence Using CI/CD and Infrastructure As Code
Increase App Confidence Using CI/CD and Infrastructure As CodeIncrease App Confidence Using CI/CD and Infrastructure As Code
Increase App Confidence Using CI/CD and Infrastructure As Code
 
Build a Tech Brand During Covid in Emerging Tech Ecosystems
Build a Tech Brand During Covid in Emerging Tech EcosystemsBuild a Tech Brand During Covid in Emerging Tech Ecosystems
Build a Tech Brand During Covid in Emerging Tech Ecosystems
 
Sailing Through a Sea of CMS: Build and Extend APIs Faster With Strapi
Sailing Through a Sea of CMS: Build and Extend APIs Faster With StrapiSailing Through a Sea of CMS: Build and Extend APIs Faster With Strapi
Sailing Through a Sea of CMS: Build and Extend APIs Faster With Strapi
 
Doing E-commerce Right – Magento on DigitalOcean
Doing E-commerce Right – Magento on DigitalOceanDoing E-commerce Right – Magento on DigitalOcean
Doing E-commerce Right – Magento on DigitalOcean
 
Headless E-commerce That People Love
Headless E-commerce That People LoveHeadless E-commerce That People Love
Headless E-commerce That People Love
 
The Cloud Hosting Revolution Creates Opportunities for Your Business
The Cloud Hosting Revolution Creates Opportunities for Your BusinessThe Cloud Hosting Revolution Creates Opportunities for Your Business
The Cloud Hosting Revolution Creates Opportunities for Your Business
 
Build, Deploy, and Scale Your First Web App Using DigitalOcean App Platform
Build, Deploy, and Scale Your First Web App Using DigitalOcean App PlatformBuild, Deploy, and Scale Your First Web App Using DigitalOcean App Platform
Build, Deploy, and Scale Your First Web App Using DigitalOcean App Platform
 
Effective Kubernetes Onboarding
Effective Kubernetes OnboardingEffective Kubernetes Onboarding
Effective Kubernetes Onboarding
 
Creating Inclusive Learning Experiences
Creating Inclusive Learning ExperiencesCreating Inclusive Learning Experiences
Creating Inclusive Learning Experiences
 
Kubernetes for Beginners
Kubernetes for BeginnersKubernetes for Beginners
Kubernetes for Beginners
 
Command-line Your Way to PaaS Productivity With DigitalOcean App Platform
Command-line Your Way to PaaS Productivity With DigitalOcean App PlatformCommand-line Your Way to PaaS Productivity With DigitalOcean App Platform
Command-line Your Way to PaaS Productivity With DigitalOcean App Platform
 
Escape the Walls of PaaS: Unlock the Power & Flexibility of DigitalOcean App ...
Escape the Walls of PaaS: Unlock the Power & Flexibility of DigitalOcean App ...Escape the Walls of PaaS: Unlock the Power & Flexibility of DigitalOcean App ...
Escape the Walls of PaaS: Unlock the Power & Flexibility of DigitalOcean App ...
 
Kubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby StepsKubernetes: Beyond Baby Steps
Kubernetes: Beyond Baby Steps
 
How to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking NeedsHow to Leverage Go for Your Networking Needs
How to Leverage Go for Your Networking Needs
 
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
Combining Cloud Native & PaaS: Building a Fully Managed Application Platform ...
 
Secrets to Building & Scaling SRE Teams
Secrets to Building & Scaling SRE TeamsSecrets to Building & Scaling SRE Teams
Secrets to Building & Scaling SRE Teams
 
Building an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult StepsBuilding an Observability Platform in 389 Difficult Steps
Building an Observability Platform in 389 Difficult Steps
 
Doing This Cloud Thing Right – a Lap Around DigitalOcean Products and a Roadm...
Doing This Cloud Thing Right – a Lap Around DigitalOcean Products and a Roadm...Doing This Cloud Thing Right – a Lap Around DigitalOcean Products and a Roadm...
Doing This Cloud Thing Right – a Lap Around DigitalOcean Products and a Roadm...
 

Kürzlich hochgeladen

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Kürzlich hochgeladen (20)

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 

Deploying to DigitalOcean With GitHub Actions

  • 1.
  • 2. Developer relations & communities Cloud & DevOps Open Source Books, acting, anchoring, filmmaking @mvkaran
  • 3.
  • 4. World class CI/CD Fully integrated with GitHub Respond to any GitHub event Community-powered workflows Any platform, any language, any cloud
  • 5. Matrix builds Streaming, searchable, linkable logs Built-in secret store Easy to write, easy to share
  • 6.
  • 7. Actions are reusable components ● Live in independent repositories ○ Public repositories for now ○ Official list: https://github/actions ● Written in JavaScript (node12) ○ May use GitHub Actions Toolkit JS for command line argument parsing, passing parameters, interacting with the GitHub API ● Or Docker ○ Similar to beta 1 actions, but with updated syntax & argument passing ○ Or point to existing actions published to Docker Hub 1 2
  • 8. Workflows Workflow files glue together existing actions ● Listen for particular triggers ● Then run shell scripts ● Or pre-existing actions ● Actions run in VMs (Linux, Win, Mac) ○ Or Docker on Linux VM 1 2 3
  • 9. Stuff to keep in mind re Workflows ● Events kick off the workflow ● Jobs run each in their own VM ○ In parallel (unless the workflow says otherwise) ○ Job specifies the VM Linux/Windows/MacOS ● Steps run in the same VM ○ Share filesystem ● Logs are searchable, link to individual lines ○ Artifacts can be saved
  • 10. A Java + Maven basic CI workflow ● A single job, with 5 steps ● Runs directly on the VM ○ Ubuntu in this case ● Actions are composable ○ Checkout is separate ○ Setup for most languages in github.com/actions ○ Maven run by shell ○ Artifact uploaded separately 1 2 3 4
  • 11. Event triggers `on: push` Complete reference in the docs: https://help.github.com/en/articles/e vents-that-trigger-workflows Listen for multiple events: on: [push, pull_request] Qualify these as needed: on: create: ref_type: tag Or for a branch: on: push: branches: - master paths: - 'test/*' Schedule with cron synax: on: schedule: - cron: '*/15 * * * *'
  • 12. Steps: Where the magic happens Complete reference in the docs: help.github.com/en/articles/configuri ng-a-workflow Run other actions: steps: - uses: actions/checkout@v1 with: ref: staging-branch Or command line scripts: - name: Build with Maven run: mvn package -DskipTests Even multi-line scripts: - name: Test with Maven run: | mvn test echo Testing separately
  • 17. Example application ● Open MCT (Open Mission Control Technologies) is a mission control framework for visualization of data on desktop and mobile devices. ● NodeJS app ● Open source under Apache 2.0 License ● Dockerized it for this demo ● github.com/nasa/openmct-tutorial
  • 19. # Trigger workflows externally on: repository_dispatch # POST /repos/:owner/:repo/dispatches { "event_type": "custom-name", "client_payload": { "custom_message": “Hello world!” } }
  • 20. # Scheduled workflows with CRON syntax on: schedule: # * is a special character in YAML # so you have to quote this string - cron: ’*/15 * * * *’
  • 21. # Resolve dependencies across jobs jobs: Job1: # ... Job2: needs: Job1 # ... Job3: needs: [Job1, Job2] # ...
  • 22. # Run a job based on previous step exit status jobs: MyJob: Steps: # ... - name: Trigger alert if: failure() # if: success() # if: canceled() # if: always()
  • 23. # Use the built-in Secrets store jobs: MyJob: steps: # ... - uses: digitalocean/action-doctl@v2 with: token: ${{ secrets.DO_ACCESS_TOKEN }}
  • 27. Run on your own hardware for free with self-hosted runners
  • 28. Free for public repositories
  • 29.
  • 31. Thank you! Let’s connect... Aug 2020 MV Karan GitHub & Twitter: @mvkaran LinkedIn: /in/mvkaran