SlideShare a Scribd company logo
1 of 29
Continuous Integration (CI), Continuous Delivery (CD),
Continuous Deployment, CI/CD Pipelines, GitHub Actions
Building a CI/CD System with GitHub Actions
1
Software University
https://softuni.bg
Svetlin Nakov, PhD
Co-Founder and Innovations
Manager @ SoftUni
https://nakov.com
2
 Software engineer, tech trainer, entrepreneur
author of 16 books
nakov.com
 4 successful tech education initiatives
 National Academy for Software
Development (NASD)
 Telerik Software Academy
 SoftUni (Software University)
 Private IT High School "SoftUni Svetlina"
About Svetlin Nakov
3
 Intro to Continuous Integration (CI),
Continuous Delivery (CD),
Continuous Deployment (CD),
and CI/CD Pipelines
 Intro to GitHub Actions
 Building CI workflow
 Building CD workflow
 Live Demo: Build CI System for JS and .NET Apps
Contents
The CI/CD Pipeline
Continuous Integration / Delivery
 CI/CD pipeline
 Continuously integrate
and release new features
 Continuous integration (CI)
 Write code, test and integrate it in the product
 Continuous delivery (CD)
 Continuously release new features
 QAs maintain and monitor the CI/CD pipeline
CI/CD Pipeline
5
 Continuous integration (CI)
 Integrating the code from different developers frequently
(several times a day)
 Automated building, and testing the software
 Typically, after each Git push in the main branch
 Allows finding integration problems and bugs early
 Continuously maintain software quality
Continuous Integration (CI)
 Continuous delivery (CD)
 Keeping your codebase deployable at any point
 CD continuously verifies that
 Software builds correctly
 Passes automated tests
 Has all the necessary configuration and assets for
deployment in production
Continuous Delivery (CD)
 Continuous deployment (CD)
 Continuous automated deployment of the software
 E.g. after each git push
 Deployment is typically done to a testing environment
 Example: https://dev.myproduct.com
 Sometimes directly to the production servers
Continuous Deployment (CD)
 CI/CD pipeline == CI + CD
 Continuously integrate, test
and release new features
 On git push, the CI/CD pipeline does automatically:
 Build the software (compile, package, sign, etc.)
 Run the automated tests (unit, integration)
 Deploy on the testing environment + run E2E tests
 Or only prepare for deployment
 Or deploy directly on production
CI/CD Pipeline
Introduction
GitHub Actions
 GitHub Actions
 Cloud-based software workflow automation
environment (CI/CD on the GitHub cloud)
 Allows creating CI/CD pipelines to build, test and
deploy software projects, directly from a GitHub repo
 https://github.com/features/actions
 Free for public repos + 2000 mins per month
for private repos with the free plan
GitHub Actions
11
 Events execute workflows
(one or several jobs, running in parallel)
 Workflows hold jobs
(e. g. build, check security, deploy)
 Jobs hold steps (e. g. "checkout the
code", "install .NET", "run tests", …)
 Steps hold actions
(commands like `dotnet test`)
GitHub Actions: Concepts
event
workflow
job
job
step 1
action 1
action 2
step 2
action
12
CI Workflow in GitHub Actions
Building a CI System for Existing JS App
13
 We have a JS App (with integration tests):
 Code: https://github.com/nakov/MVC-app-integration-tests-example-mocha
 Live: https://nakov-mvc-node-app.herokuapp.com
Sample JS App: Students Registry
14
 Clone the app repo
 Restore the Node packages:
 Run the Mocha integration tests
Build and Run Locally (by Hand)
git clone https://github.com/nakov/MVC-app-integration-
tests-example-mocha
npm install
npm test
15
 Let's implement a CI/CD
pipeline in GitHub Actions
 Build & test workflow
 Runs on push
 Deploy workflow
 Runs manually
CI/CD Pipeline in GitHub Actions
16
name: Build and Test
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: npm test
GitHub Actions: Build & Test Workflow
mocha-tests.yml
Auto run on each "push"
Install Node.js
Install dependencies and build the app
Run the automated tests
Clone the repo
17
name: Deploy to Heroku
on: [workflow_dispatch]
jobs:
deploy-to-heroku:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/heroku-deploy@v3.6.8
with:
heroku_app_name: "some-app-name"
heroku_email: ${{secrets.HEROKU_EMAIL}}
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
GitHub Actions: Manual Deploy Workflow
deploy.yml
Run the workflow
manually
Clone the repo
Deploy in
Heroku
18
 GitHub Project  Settings  Secrets
Security Warning: Use Repository Secrets!
19
Live Demo
CI Workflow for JS App
in GitHub Actions
https://github.com/nakov/MVC-app-
integration-tests-example-mocha/actions
20
.NET MVC App + REST API + Desktop App + Android App
CI System for More Complex System
21
 We have a .NET Web app (with tests):
Continuous Integration for .NET Apps
 Code: https://github.com/nakov/Eventures
22
GitHub Actions: Build & Test Workflow
name: Build and Test
on: [push]
jobs:
WebApp-tests:
# Buld and run tests for the Eventures Web App …
WebApi-tests:
# Buld and run tests for the Eventures Web API …
DesktopApp-tests:
# Buld and run tests for the Eventures Desktop App …
AndroidApp-tests:
# Buld and run tests for the Eventures Android App …
dotnet-build.yml
23
GitHub Actions: Web App Tests Job
24
GitHub Actions: Web API Tests Job
25
GitHub Actions: Desktop App Tests Job
26
GitHub Actions: Android App Tests Job
27
Live Demo
CI Workflow for .NET
App in GitHub Actions
https://github.com/nakov/Eventures/blob/main/
.github/workflows/dotnet-build.yml
28
SoftUni – https://softuni.bg

More Related Content

What's hot

Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
Julien Pivotto
 

What's hot (20)

Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Container based CI/CD on GitHub Actions
Container based CI/CD on GitHub ActionsContainer based CI/CD on GitHub Actions
Container based CI/CD on GitHub Actions
 
CICD Pipeline Using Github Actions
CICD Pipeline Using Github ActionsCICD Pipeline Using Github Actions
CICD Pipeline Using Github Actions
 
Red Hat OpenShift on Bare Metal and Containerized Storage
Red Hat OpenShift on Bare Metal and Containerized StorageRed Hat OpenShift on Bare Metal and Containerized Storage
Red Hat OpenShift on Bare Metal and Containerized Storage
 
DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub Actions
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
 
CI/CD on AWS
CI/CD on AWSCI/CD on AWS
CI/CD on AWS
 
OpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformOpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platform
 
Github in Action
Github in ActionGithub in Action
Github in Action
 
Introduction to openshift
Introduction to openshiftIntroduction to openshift
Introduction to openshift
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
 
DevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterDevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver Faster
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Kubernetes Deployment Strategies
Kubernetes Deployment StrategiesKubernetes Deployment Strategies
Kubernetes Deployment Strategies
 

Similar to GitHub Actions (Nakov at RuseConf, Sept 2022)

Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshiftTekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
bashwen2022
 

Similar to GitHub Actions (Nakov at RuseConf, Sept 2022) (20)

GitHub Actions for 5 minutes
GitHub Actions for 5 minutesGitHub Actions for 5 minutes
GitHub Actions for 5 minutes
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Turnkey Continuous Delivery
Turnkey Continuous DeliveryTurnkey Continuous Delivery
Turnkey Continuous Delivery
 
Serving Pull Requests with Jenkins
Serving Pull Requests with JenkinsServing Pull Requests with Jenkins
Serving Pull Requests with Jenkins
 
Deploying Mule Applications with Jenkins, Azure and BitBucket (1).pptx
Deploying Mule Applications with Jenkins, Azure and BitBucket (1).pptxDeploying Mule Applications with Jenkins, Azure and BitBucket (1).pptx
Deploying Mule Applications with Jenkins, Azure and BitBucket (1).pptx
 
TMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasTMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael Palotas
 
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group MeetupOpenShift Build Pipelines @ Lightweight Java User Group Meetup
OpenShift Build Pipelines @ Lightweight Java User Group Meetup
 
AWS Code Services
AWS Code ServicesAWS Code Services
AWS Code Services
 
CICD_1670665418.pdf
CICD_1670665418.pdfCICD_1670665418.pdf
CICD_1670665418.pdf
 
Continuous Integration using Jenkins with Python
Continuous Integration using Jenkins with PythonContinuous Integration using Jenkins with Python
Continuous Integration using Jenkins with Python
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)
 
How to set up an ASP.NET 5 Continuous Delivery Pipeline using IBM Bluemix Dev...
How to set up an ASP.NET 5 Continuous Delivery Pipeline using IBM Bluemix Dev...How to set up an ASP.NET 5 Continuous Delivery Pipeline using IBM Bluemix Dev...
How to set up an ASP.NET 5 Continuous Delivery Pipeline using IBM Bluemix Dev...
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applications
 
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshiftTekton_ArgoCD-_KCD_Taiwan-cicd-openshift
Tekton_ArgoCD-_KCD_Taiwan-cicd-openshift
 
CICD Pipeline - AWS Azure
CICD Pipeline - AWS AzureCICD Pipeline - AWS Azure
CICD Pipeline - AWS Azure
 
Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration Continuous Delivery, Continuous Integration
Continuous Delivery, Continuous Integration
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CD
 
Attacking Pipelines--Security meets Continuous Delivery
Attacking Pipelines--Security meets Continuous DeliveryAttacking Pipelines--Security meets Continuous Delivery
Attacking Pipelines--Security meets Continuous Delivery
 

More from Svetlin Nakov

Дипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП - Светлин НаковДипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Svetlin Nakov
 
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
Свободно ИТ учебно съдържание за учители по програмиране и ИТСвободно ИТ учебно съдържание за учители по програмиране и ИТ
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
Svetlin Nakov
 
Blockchain and DeFi Overview (Nakov, Sept 2021)
Blockchain and DeFi Overview (Nakov, Sept 2021)Blockchain and DeFi Overview (Nakov, Sept 2021)
Blockchain and DeFi Overview (Nakov, Sept 2021)
Svetlin Nakov
 

More from Svetlin Nakov (20)

BG-IT-Edu: отворено учебно съдържание за ИТ учители
BG-IT-Edu: отворено учебно съдържание за ИТ учителиBG-IT-Edu: отворено учебно съдържание за ИТ учители
BG-IT-Edu: отворено учебно съдържание за ИТ учители
 
Programming World in 2024
Programming World in 2024Programming World in 2024
Programming World in 2024
 
AI Tools for Business and Startups
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
 
AI Tools for Scientists - Nakov (Oct 2023)
AI Tools for Scientists - Nakov (Oct 2023)AI Tools for Scientists - Nakov (Oct 2023)
AI Tools for Scientists - Nakov (Oct 2023)
 
AI Tools for Entrepreneurs
AI Tools for EntrepreneursAI Tools for Entrepreneurs
AI Tools for Entrepreneurs
 
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
 
AI Tools for Business and Personal Life
AI Tools for Business and Personal LifeAI Tools for Business and Personal Life
AI Tools for Business and Personal Life
 
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП - Светлин НаковДипломна работа: учебно съдържание по ООП - Светлин Наков
Дипломна работа: учебно съдържание по ООП - Светлин Наков
 
Дипломна работа: учебно съдържание по ООП
Дипломна работа: учебно съдържание по ООПДипломна работа: учебно съдържание по ООП
Дипломна работа: учебно съдържание по ООП
 
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
Свободно ИТ учебно съдържание за учители по програмиране и ИТСвободно ИТ учебно съдържание за учители по програмиране и ИТ
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
 
AI and the Professions of the Future
AI and the Professions of the FutureAI and the Professions of the Future
AI and the Professions of the Future
 
Programming Languages Trends for 2023
Programming Languages Trends for 2023Programming Languages Trends for 2023
Programming Languages Trends for 2023
 
IT Professions and How to Become a Developer
IT Professions and How to Become a DeveloperIT Professions and How to Become a Developer
IT Professions and How to Become a Developer
 
IT Professions and Their Future
IT Professions and Their FutureIT Professions and Their Future
IT Professions and Their Future
 
How to Become a QA Engineer and Start a Job
How to Become a QA Engineer and Start a JobHow to Become a QA Engineer and Start a Job
How to Become a QA Engineer and Start a Job
 
Призвание и цели: моята рецепта
Призвание и цели: моята рецептаПризвание и цели: моята рецепта
Призвание и цели: моята рецепта
 
What Mongolian IT Industry Can Learn from Bulgaria?
What Mongolian IT Industry Can Learn from Bulgaria?What Mongolian IT Industry Can Learn from Bulgaria?
What Mongolian IT Industry Can Learn from Bulgaria?
 
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
How to Become a Software Developer - Nakov in Mongolia (Oct 2022)
 
Blockchain and DeFi Overview (Nakov, Sept 2021)
Blockchain and DeFi Overview (Nakov, Sept 2021)Blockchain and DeFi Overview (Nakov, Sept 2021)
Blockchain and DeFi Overview (Nakov, Sept 2021)
 
Дигитални професии на бъдещето: не бъдете роботи! (юни 2021)
Дигитални професии на бъдещето: не бъдете роботи! (юни 2021)Дигитални професии на бъдещето: не бъдете роботи! (юни 2021)
Дигитални професии на бъдещето: не бъдете роботи! (юни 2021)
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

GitHub Actions (Nakov at RuseConf, Sept 2022)

  • 1. Continuous Integration (CI), Continuous Delivery (CD), Continuous Deployment, CI/CD Pipelines, GitHub Actions Building a CI/CD System with GitHub Actions 1 Software University https://softuni.bg Svetlin Nakov, PhD Co-Founder and Innovations Manager @ SoftUni https://nakov.com
  • 2. 2  Software engineer, tech trainer, entrepreneur author of 16 books nakov.com  4 successful tech education initiatives  National Academy for Software Development (NASD)  Telerik Software Academy  SoftUni (Software University)  Private IT High School "SoftUni Svetlina" About Svetlin Nakov
  • 3. 3  Intro to Continuous Integration (CI), Continuous Delivery (CD), Continuous Deployment (CD), and CI/CD Pipelines  Intro to GitHub Actions  Building CI workflow  Building CD workflow  Live Demo: Build CI System for JS and .NET Apps Contents
  • 4. The CI/CD Pipeline Continuous Integration / Delivery
  • 5.  CI/CD pipeline  Continuously integrate and release new features  Continuous integration (CI)  Write code, test and integrate it in the product  Continuous delivery (CD)  Continuously release new features  QAs maintain and monitor the CI/CD pipeline CI/CD Pipeline 5
  • 6.  Continuous integration (CI)  Integrating the code from different developers frequently (several times a day)  Automated building, and testing the software  Typically, after each Git push in the main branch  Allows finding integration problems and bugs early  Continuously maintain software quality Continuous Integration (CI)
  • 7.  Continuous delivery (CD)  Keeping your codebase deployable at any point  CD continuously verifies that  Software builds correctly  Passes automated tests  Has all the necessary configuration and assets for deployment in production Continuous Delivery (CD)
  • 8.  Continuous deployment (CD)  Continuous automated deployment of the software  E.g. after each git push  Deployment is typically done to a testing environment  Example: https://dev.myproduct.com  Sometimes directly to the production servers Continuous Deployment (CD)
  • 9.  CI/CD pipeline == CI + CD  Continuously integrate, test and release new features  On git push, the CI/CD pipeline does automatically:  Build the software (compile, package, sign, etc.)  Run the automated tests (unit, integration)  Deploy on the testing environment + run E2E tests  Or only prepare for deployment  Or deploy directly on production CI/CD Pipeline
  • 11.  GitHub Actions  Cloud-based software workflow automation environment (CI/CD on the GitHub cloud)  Allows creating CI/CD pipelines to build, test and deploy software projects, directly from a GitHub repo  https://github.com/features/actions  Free for public repos + 2000 mins per month for private repos with the free plan GitHub Actions 11
  • 12.  Events execute workflows (one or several jobs, running in parallel)  Workflows hold jobs (e. g. build, check security, deploy)  Jobs hold steps (e. g. "checkout the code", "install .NET", "run tests", …)  Steps hold actions (commands like `dotnet test`) GitHub Actions: Concepts event workflow job job step 1 action 1 action 2 step 2 action 12
  • 13. CI Workflow in GitHub Actions Building a CI System for Existing JS App 13
  • 14.  We have a JS App (with integration tests):  Code: https://github.com/nakov/MVC-app-integration-tests-example-mocha  Live: https://nakov-mvc-node-app.herokuapp.com Sample JS App: Students Registry 14
  • 15.  Clone the app repo  Restore the Node packages:  Run the Mocha integration tests Build and Run Locally (by Hand) git clone https://github.com/nakov/MVC-app-integration- tests-example-mocha npm install npm test 15
  • 16.  Let's implement a CI/CD pipeline in GitHub Actions  Build & test workflow  Runs on push  Deploy workflow  Runs manually CI/CD Pipeline in GitHub Actions 16
  • 17. name: Build and Test on: [push] jobs: build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 - run: npm ci - run: npm test GitHub Actions: Build & Test Workflow mocha-tests.yml Auto run on each "push" Install Node.js Install dependencies and build the app Run the automated tests Clone the repo 17
  • 18. name: Deploy to Heroku on: [workflow_dispatch] jobs: deploy-to-heroku: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: akhileshns/heroku-deploy@v3.6.8 with: heroku_app_name: "some-app-name" heroku_email: ${{secrets.HEROKU_EMAIL}} heroku_api_key: ${{secrets.HEROKU_API_KEY}} GitHub Actions: Manual Deploy Workflow deploy.yml Run the workflow manually Clone the repo Deploy in Heroku 18
  • 19.  GitHub Project  Settings  Secrets Security Warning: Use Repository Secrets! 19
  • 20. Live Demo CI Workflow for JS App in GitHub Actions https://github.com/nakov/MVC-app- integration-tests-example-mocha/actions 20
  • 21. .NET MVC App + REST API + Desktop App + Android App CI System for More Complex System 21
  • 22.  We have a .NET Web app (with tests): Continuous Integration for .NET Apps  Code: https://github.com/nakov/Eventures 22
  • 23. GitHub Actions: Build & Test Workflow name: Build and Test on: [push] jobs: WebApp-tests: # Buld and run tests for the Eventures Web App … WebApi-tests: # Buld and run tests for the Eventures Web API … DesktopApp-tests: # Buld and run tests for the Eventures Desktop App … AndroidApp-tests: # Buld and run tests for the Eventures Android App … dotnet-build.yml 23
  • 24. GitHub Actions: Web App Tests Job 24
  • 25. GitHub Actions: Web API Tests Job 25
  • 26. GitHub Actions: Desktop App Tests Job 26
  • 27. GitHub Actions: Android App Tests Job 27
  • 28. Live Demo CI Workflow for .NET App in GitHub Actions https://github.com/nakov/Eventures/blob/main/ .github/workflows/dotnet-build.yml 28

Editor's Notes

  1. Continuous integration (CI) is the practice of frequent integration, together with automated building and automated testing of the software after each push in the master branch. This ensures that the new code integrates correctly with the existing code: compiles without errors and passes all existing automated tests. Continuous integration (CI), together with automated testing allows developers to find the bugs early and to continuously maintain the quality of the software.
  2. Continuous Delivery (CD) is the practice of keeping your codebase deployable at any point. This means to continuously verify that the software builds correctly, passes the automated tests and have all the configuration necessary to push it into production. Continuous delivery (CD) allows to integrate, deploy and release new features continuously in short release cycles with a lot of automation.
  3. Continuous Deployment (CD) is the practice of automatically deploy the software to a testing or production environment after each significant change (e.g. after "git push" in the master branch).
  4. Continuous integration and continuous delivery (the so-called CI/CD pipeline) is a practice in modern software development, where the code is integrated, tested and deployed continuously and automatically after each significant change in the code.