Continuous Integration and Deployment with GitHub Actions

Continuous Integration and Deployment is an intermediate-level course of 5 lessons (about 1 h 30 min), with 17 exercises and 17 quiz questions. Prerequisites: Git and GitHub, Automated Testing. The course needs a full project environment, planned for a later phase of the platform.

  • Cloud and DevOps
  • Intermediate
  • 5 lessons
  • 1 h 30 min
  • 17 exercises
  • Full project environment (phase 2)

The course in brief

This course teaches you how to build a continuous integration and deployment pipeline with GitHub Actions. You will write workflows that test across several versions, check quality, pass artifacts along, then deploy automatically to protected environments. You will finish with security: secrets, least-privilege permissions, OIDC and pinning actions.

What you will be able to do

  • Write a GitHub Actions workflow with triggers, dependent jobs and steps
  • Make CI mandatory with branch protection
  • Test on a version matrix with caching, lint, coverage and a service database
  • Pass artifacts and outputs between jobs and publish a release on a tag
  • Deploy automatically to staging then production with approval, a concurrency lock, a smoke test and rollback
  • Secure a pipeline: environment secrets, least-privilege permissions, OIDC and pinned actions

Syllabus: 5 lessons

    • Explain what continuous integration and continuous deployment are
    • Read and write a workflow: triggers, jobs, steps, runners
    • Chain jobs with needs and protect the main branch with required checks

    Continuous integrationGitHub Actions workflowTriggersBranch protection

  1. 02

    Tests and Quality in CI

    20 min
    • Test on several versions with a matrix
    • Speed up the pipeline with dependency caching
    • Add lint, minimum coverage and a test database to the pipeline

    Version matrixDependency cacheLint and coverageService containers

  2. 03

    Artifacts, Job Outputs and Releases

    15 min
    • Pass files from one job to another with artifacts
    • Pass a value between steps and between jobs with outputs
    • Publish a release from a version tag

    ArtifactsJob outputsReleases

  3. 04

    Automated Deployment and Environments

    20 min
    • Deploy automatically after CI, only from main
    • Protect production with an environment requiring approval
    • Avoid concurrent deployments, verify after deployment and know how to roll back

    Continuous deploymentDeployment environmentsDeployment concurrencyRollback

  4. 05

    Secrets and Pipeline Security

    20 min
    • Manage secrets and variables at the right level
    • Reduce the GITHUB_TOKEN's permissions
    • Connect to the cloud without long-lived keys and secure the supply chain

    Secrets and variablesToken permissionsOIDC federationCI supply chain security

Final project

Complete CI/CD Pipeline for a Web Application

For an application from the learning path (Node.js, Python or PHP API with a PostgreSQL database), set up a complete GitHub Actions pipeline: lint and tests on a version matrix, integration tests against Postgres, a single build passed along as an artifact, automatic deployment to staging from main with a smoke test, production subject to approval, a rollback workflow and a release on tag. The pipeline follows the course's security checklist.

Deliverables

  • The files .github/workflows/ci-cd.yml, release.yml and rollback.yml
  • The configuration of the staging and production environments (screenshots or description of the expected rules and secrets)
  • A protection rule on main requiring the CI checks
  • A README describing the flow, the required secrets and variables, and the rollback procedure

Assessment criteria

  • A pull request with a broken test cannot be merged
  • The same artifact built once is verified then deployed
  • Production is only deployed after a successful staging, a green smoke test and approval
  • Two deployments cannot run simultaneously and rollback is demonstrated
  • Minimal permissions, secrets in environments, no user input injected into run, third-party actions pinned

Frequently asked questions

Do I need to know Docker to take this course?

No. The course focuses on the pipeline itself. Building and publishing Docker images is covered in the Docker and Deployment course, which the examples refer to.

Do the concepts apply outside GitHub?

Yes. Triggers, jobs, artifacts, environments and secrets exist under similar names in GitLab CI, Azure Pipelines or Jenkins. Only the syntax changes.

What is the difference between continuous delivery and continuous deployment?

In continuous delivery, every validated version is ready to ship but a person triggers the release to production. In continuous deployment, it ships automatically. An environment with approval lets you move from one to the other.

Do I need a cloud account?

Not for the most part: the exercises use a GitHub repository and simulated deployments. The OIDC connection to a cloud provider is explained with an example you can apply to your own account.

This course, told for your job

Say what you want to be able to do: “Continuous Integration and Deployment” takes its place in your path, with examples from your field. The concepts stay those of the course.

The preview is free, and you can take the courses one at a time without paying. The path only contains lessons from the catalogue.