Skip to content

Commit

Permalink
use ruby 3.0 for dpl v2 and update tag naming and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsorokoletov committed Jan 10, 2024
1 parent 463e8fd commit 1ca121f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,30 @@ name: Docker Build and Push
on:
push:
branches:
- master # Set your default branch here
- master
- pre

env:
RUBY_VERSION: '3.0' # Define the Ruby version here

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Check Out Repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: dreamteammobile/gitlab-runner-heroku-dpl:${{ github.ref == 'refs/heads/pre' && 'v2' || 'latest' }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: dreamteammobile/gitlab-runner-heroku-dpl:${{ github.ref == 'refs/heads/pre' && 'v2' || 'v1' }}_${{ env.RUBY_VERSION }}
build-args: RUBY_VERSION=${{ env.RUBY_VERSION }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.7.5-alpine
ARG RUBY_VERSION
FROM ruby:${RUBY_VERSION}-alpine
RUN apk --no-cache add git curl
RUN gem install dpl --pre

0 comments on commit 1ca121f

Please sign in to comment.