Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Commit b814f3f

Browse files
authored
Add docker, docker-compose and GitHub Actions support for Podiscover (#89)
* Add docker and docker-compose support for Podiscover * Update precompile commands to reduce post command executions * Implement GitHub Actions as CI/CD for Pull Requests * Add action step to copy Gemfiles for docker build * Move precompile assets command to Actions * Update Actions build job * Update Actions build job * Remove precompile * Change build * Fix action data usage * Add archive step * Finalize GitHub Action * Use a single Gemfile and update to ruby 3.2.2 * Remove Gemfile copy step from pipeline
1 parent ebf0ccc commit b814f3f

File tree

9 files changed

+200
-104
lines changed

9 files changed

+200
-104
lines changed

.github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Build Podiscover on Docker
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Build Docker Image for Podiscover
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Build Docker Image
18+
run: docker build -t podiscover:${{github.sha}} .

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@
3535
.env
3636

3737
# Ignore editor files
38-
.nova/
38+
.nova/
39+
40+
postgres-data

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-3.2.1
1+
ruby-3.2.2

Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use the official Ruby image as the parent image
2+
FROM ruby:3.2.2
3+
4+
# Set the working directory to /app
5+
WORKDIR /app
6+
7+
# Copy the Gemfile and Gemfile.lock into the image
8+
COPY Gemfile Gemfile.lock ./
9+
10+
# Install dependencies
11+
RUN bundle install
12+
13+
# Copy the rest of the application code into the image
14+
COPY . .
15+
16+
# Expose port 3000 for the Rails server
17+
EXPOSE 3000
18+
19+
# Start the Rails server
20+
CMD ["rails", "server", "-b", "0.0.0.0"]

Gemfile

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
source 'https://gem.fury.io/enderahmetyurt/' do
7-
gem 'rspotify'
8-
end
6+
ruby '3.2.2'
97

10-
ruby '3.2.1'
8+
gem 'rspotify', git: 'https://github.com/enderahmetyurt/rspotify'
119

1210
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
1311
gem 'rails', '7.0.4.3'
@@ -65,7 +63,7 @@ group :development, :test do
6563
gem 'pry'
6664
gem 'rspec-rails'
6765
gem 'factory_bot_rails'
68-
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'master'
66+
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
6967
gem "rubocop", "~> 1.0"
7068
gem "standard", "~> 1.0"
7169
end

0 commit comments

Comments
 (0)