https://github.com/nutcas3/simple-ci-ruby
https://github.com/nutcas3/simple-ci-ruby
ci-cd ruby-on-rails security
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nutcas3/simple-ci-ruby
- Owner: nutcas3
- Created: 2025-06-11T13:59:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-12T08:01:46.000Z (about 1 year ago)
- Last Synced: 2025-06-22T22:07:09.784Z (about 1 year ago)
- Topics: ci-cd, ruby-on-rails, security
- Language: Ruby
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rails CI/CD Demo
A modern Ruby on Rails application demonstrating CI/CD best practices, automated testing, and deployment workflows.
## ๐ Features
### Application
- Basic blog functionality with posts
- Modern, responsive UI
- PostgreSQL database
- RESTful API design
### Development
- ๐ Ruby 3.2.2 + Rails 7.1
- ๐ฆ Docker + Docker Compose configuration
- ๐งช Comprehensive RSpec test suite
- ๐จ RuboCop for code style enforcement
### CI/CD Pipeline
- ๐ GitHub Actions workflow
- โก๏ธ Parallel test execution with Knapsack
- ๐ Security scanning (Brakeman, Bundler Audit)
- ๐ Automated deployments to Heroku
- ๐ Preview environments for PRs
## ๐ Prerequisites
- Ruby 3.2.2
- PostgreSQL 14+
- Docker & Docker Compose
- Node.js 18+
## ๐ Quick Start
1. Clone the repository:
```bash
git clone https://github.com/yourusername/rails-cicd-demo.git
cd rails-cicd-demo
```
2. Install dependencies:
```bash
bundle install
```
3. Set up the database:
```bash
rails db:create db:migrate
```
4. Start the server:
```bash
rails server
```
5. Visit http://localhost:3000
## ๐ณ Docker Setup
1. Build the containers:
```bash
docker-compose build
```
2. Start the services:
```bash
docker-compose up
```
3. Create and migrate the database:
```bash
docker-compose exec web rails db:setup
```
## ๐งช Testing
Run the test suite:
```bash
rspec
```
Run specific tests:
```bash
rspec spec/models/post_spec.rb
```
## ๐ CI/CD Pipeline
The GitHub Actions workflow includes:
1. **Lint & Security**
- RuboCop style checking
- Brakeman security analysis
- Bundler Audit dependency checks
2. **Test**
- Parallel test execution
- Coverage reporting
3. **Build**
- Docker image building
- Image pushing to registry
4. **Deploy**
- Preview environment for PRs
- Production deployment for main branch
## ๐ Documentation
- [Setup Guide](docs/setup.md)
- [Contributing Guidelines](CONTRIBUTING.md)
- [Deployment Guide](docs/deployment.md)
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.