This project demonstrates how Dependabot can manage dependencies beyond just npm packages, including GitHub Actions, Docker images, and Kubernetes manifests.
This repository is configured to have Dependabot automatically monitor and update:
- Package dependencies in
package.json - Dependabot will create PRs when new versions are available
- Example:
@nestjs/core,@nestjs/platform-express,rxjs, etc.
- GitHub Actions versions in
.github/workflows/ci-cd.yaml - Monitors actions like:
actions/checkout@v4actions/setup-node@v4docker/setup-buildx-action@v3docker/login-action@v3docker/metadata-action@v5docker/build-push-action@v5azure/setup-kubectl@v3
- Base images in
Dockerfile - Monitors:
node:20-alpine - Dependabot will suggest updates when new Node.js versions or security patches are available
- While Dependabot doesn't directly update Kubernetes YAML values, it monitors the Docker images referenced
- Located in
k8s/deployment.yamlandk8s/service.yaml
- Development container configuration in
.devcontainer/ - Monitors base images in
.devcontainer/Dockerfile - Base image:
node:20-bullseye - Includes development tools: kubectl, Docker CLI, NestJS CLI
- Provides consistent development environment across all contributors
.
βββ .devcontainer/
β βββ Dockerfile # Development container image
β βββ devcontainer.json # VS Code devcontainer config
β βββ README.md # Devcontainer documentation
βββ .github/
β βββ dependabot.yml # Dependabot configuration
β βββ workflows/
β βββ ci-cd.yaml # GitHub Actions pipeline
βββ k8s/
β βββ deployment.yaml # Kubernetes deployment manifest
β βββ service.yaml # Kubernetes service manifest
βββ slides/
β βββ slides.md # Slidev presentation (Norwegian)
β βββ exports/ # Exported PDF presentations
βββ src/
β βββ app.controller.ts
β βββ app.module.ts
β βββ app.service.ts
β βββ main.ts
βββ Dockerfile # Multi-stage Docker build
βββ .dockerignore
βββ package.json
The .github/dependabot.yml file configures four package ecosystems:
version: 2
updates:
- package-ecosystem: "npm" # npm dependencies with grouping
- package-ecosystem: "github-actions" # GitHub Actions versions
- package-ecosystem: "docker" # Docker base images (main app)
- package-ecosystem: "docker" # Docker base images (devcontainer)- Package Grouping: Related npm packages grouped together (NestJS, testing, TypeScript)
- Multiple Directories: Separate Docker monitoring for app and devcontainer
- Daily Updates: All ecosystems checked daily
- Custom Labels: PRs automatically labeled by ecosystem
The easiest way to get started is using the devcontainer:
In VS Code:
# Install "Dev Containers" extension
# Open this project in VS Code
# Click "Reopen in Container" when prompted
# Everything is configured automatically!In GitHub Codespaces:
# Click "Code" β "Codespaces" β "New codespace"
# Your environment is ready in seconds# Install dependencies
npm install
# Run in development mode
npm run start:dev
# Run tests
npm run test
# Run e2e tests
npm run test:e2e# Build the Docker image
docker build -t nestjs-app:latest .
# Run the container
docker run -p 3000:3000 nestjs-app:latest# Apply Kubernetes manifests
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
# Check deployment status
kubectl rollout status deployment/nestjs-app
# Get service information
kubectl get service nestjs-app-serviceThe GitHub Actions workflow (.github/workflows/ci-cd.yaml) includes:
- Test Job: Linting, unit tests, and e2e tests
- Build Job: Docker image build and push
- Deploy Job: Kubernetes deployment (on main branch)
A Norwegian presentation about Dependabot is included using Slidev:
# Run the presentation in your browser
npm run slides
# Build static version
npm run slides:build
# Export to PDF (requires Playwright)
npm run slides:exportThe presentation covers:
- Slide 1: What is Dependabot?
- Slide 2: How Dependabot helps developers
Automatic PDF Export: When slides/slides.md is updated on the main branch, a GitHub Actions workflow automatically exports the presentation to PDF and saves it in the slides/exports/ folder.
Once this repository is pushed to GitHub, Dependabot will:
- Scan weekly for updates (configured in
dependabot.yml) - Create pull requests when updates are found
- Label PRs appropriately (e.g.,
dependencies,npm,docker,github-actions) - Group related updates when possible
- Run CI checks on the PRs automatically
- "Bump @nestjs/core from 10.0.0 to 10.1.0"
- "Bump actions/checkout from 4.0.0 to 4.1.0"
- "Bump node from 20-alpine to 21-alpine in Dockerfile"
- Security: Automatically update dependencies with security vulnerabilities
- Maintenance: Keep dependencies up-to-date without manual effort
- Consistency: Standardized update process across npm, Docker, and GitHub Actions
- Visibility: PRs provide clear changelog and release notes
- Copy
.github/dependabot.ymlto your repository - Customize the
schedule,labels, andopen-pull-requests-limitas needed - Push to GitHub - Dependabot will start automatically!
MIT