Skip to content

Commit

Permalink
Do it in one step
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Aug 1, 2024
1 parent 6bf4cf4 commit 3dfaf68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ jobs:
ruby-version: 3.3.3
bundler-cache: true

- name: Build docker image
run: bin/rake docker:build[${{ matrix.version }},${{ matrix.line_editor }},${{ matrix.compiler }}]

- name: Push docker image
run: bin/rake docker:push[${{ matrix.version }},${{ matrix.line_editor }},${{ matrix.compiler }}]
- name: Build and push docker image
run: bin/rake docker:build_and_push[${{ matrix.version }},${{ matrix.line_editor }},${{ matrix.compiler }}]
env:
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}

Expand Down
30 changes: 10 additions & 20 deletions tasks/docker.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,27 @@ namespace :docker do
end

desc "Build the default docker image"
task :build_default do
task :build do
Docker::Manager.build_default
end

desc "Builds a docker image"
task :build, %i[version line_editor compiler] do |_t, opts|
desc "Build a ruby trunk image"
task :build_and_push_head, %i[line_editor compiler] do |_t, opts|
manager = Docker::Manager.new(
version: opts[:version],
version: "head",
line_editor: opts[:line_editor],
compiler: opts[:compiler]
)

manager.build
manager.login
manager.push
end

desc "Build a ruby trunk image"
task :build_and_push_head, %i[line_editor compiler] do |_t, opts|
desc "Build and push an image"
task :build_and_push, %i[version line_editor compiler] do |_t, opts|
manager = Docker::Manager.new(
version: "head",
version: opts[:version],
line_editor: opts[:line_editor],
compiler: opts[:compiler]
)
Expand All @@ -53,19 +55,7 @@ namespace :docker do
end

desc "Push the default docker image to dockerhub"
task :push_default do
task :push do
Docker::Manager.push_default
end

desc "Pushes a docker image"
task :push, %i[version line_editor compiler] do |_t, opts|
manager = Docker::Manager.new(
version: opts[:version],
line_editor: opts[:line_editor],
compiler: opts[:compiler]
)

manager.login
manager.push
end
end

0 comments on commit 3dfaf68

Please sign in to comment.