From 1ca121fd99a93c2f580dfbe861d3ea75a50a6eba Mon Sep 17 00:00:00 2001 From: Alex Sorokoletov Date: Wed, 10 Jan 2024 00:52:04 -0500 Subject: [PATCH] use ruby 3.0 for dpl v2 and update tag naming and dockerfile --- .github/workflows/docker-image.yml | 34 +++++++++++++++++------------- Dockerfile | 4 ++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0d46cbc..64ede06 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 509c0b4..8fec5bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 -