CI/CD: GitHub Actions
This course works through a Rails application's GitHub Actions pipeline, starting from the CI file generated by rails new. It explains events, jobs, runners and steps, then adds the missing RSpec job with a PostgreSQL service container. Later lessons cover speed through parallel jobs, concurrency, caching and timeouts. They also cover flaky tests, failure artifacts and the limits of a green check. Secrets, token permissions, OIDC and fork pull requests come next, and the course ends with a gated Kamal deploy job and the complete workflow file.
What you'll learn
- ✓How events, jobs, runners and steps form a workflow
- ✓Running RSpec in CI with a PostgreSQL service container
- ✓Speeding up a pipeline with needs, concurrency, caching and timeouts
- ✓Handling flaky tests and keeping failure screenshots as artifacts
- ✓Managing secrets, GITHUB_TOKEN permissions and pull requests from forks
- ✓Adding a gated Kamal deploy job to the workflow
The CI you already have
This application has a CI pipeline. It was generated by rails new, it has been running on every pull request since the first commit, and most people who work on a Rails app have never opened it.
Read the full lesson free →Curriculum
7 lessonsThe CI you already have
Reads the CI file generated by rails new, explains its four core ideas, and finds it never runs RSpec.
Adding the job that runs the tests
Adds a test job with a PostgreSQL service container, health checks, libpq variables, db:test:prepare and Chrome for system specs.
Making the pipeline fast
Shows how needs, concurrency, cache keys, timeouts and sharding matrices affect how long the pipeline takes.
What a green check is worth
Covers sources of flaky tests, reproducing order failures with a seed, failure artifacts, and what CI cannot tell you.
Secrets, permissions, and the token
Explains where values belong, the limits of masking, token permissions, OIDC credentials, fork pull requests and pinning actions.
From CI to CD
Builds a deploy job with needs, if and environment, plus review gates, queued concurrency and the Kamal setup.
Putting it together: the full pipeline
Assembles the full workflow file and explains why each setting is there, from permissions to the queued deploy.