From b32d8de1124e526d58cc0c2ea1022e5ae2703af7 Mon Sep 17 00:00:00 2001 From: Raphael Nestler Date: Mon, 6 Jan 2025 14:21:36 +0100 Subject: [PATCH 1/4] Regenerate Gemfile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9eb060d..b3dd0b9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -475,7 +475,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.3.4p94 + ruby 3.3.6p108 BUNDLED WITH 2.5.14 From 6b41c37ef0cc985a0311f75b836094592cbc0b89 Mon Sep 17 00:00:00 2001 From: Raphael Nestler Date: Mon, 6 Jan 2025 14:21:45 +0100 Subject: [PATCH 2/4] Fix warnings in Dockerfile Fixes the following warnings: => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 5) => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 17) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2ca87f2..a363a01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile ARG RUBY_VERSION=3.3.6 -FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base +FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base # Rails app lives here WORKDIR /rails @@ -14,7 +14,7 @@ ENV RAILS_ENV="production" \ BUNDLE_WITHOUT="development" # Throw-away build stage to reduce size of final image -FROM base as build +FROM base AS build # Install packages needed to build gems RUN apt-get update -qq && \ From 2ceb2e634abc18aab4fe5275fd347f7b305978d6 Mon Sep 17 00:00:00 2001 From: Raphael Nestler Date: Mon, 6 Jan 2025 14:24:33 +0100 Subject: [PATCH 3/4] Add step to build docker container during CI --- .github/workflows/docker-build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..dfefeb9 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,14 @@ +name: Docker build + +on: [push] + +jobs: + docker-build: + runs-on: ubuntu-24.04 + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t "${REGISTRY}/${IMAGE_NAME}" . From 80f6fd0153d02e7791048b058f3ad75aae7a7119 Mon Sep 17 00:00:00 2001 From: Raphael Nestler Date: Mon, 6 Jan 2025 14:31:10 +0100 Subject: [PATCH 4/4] Add docker publish workflow --- .github/workflows/docker-publish.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..8183796 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,24 @@ +name: Docker Publish + +on: + push: + branches: ["main"] + +jobs: + docker-build: + runs-on: ubuntu-24.04 + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + steps: + - uses: actions/checkout@v4 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Docker image + run: docker build -t "${REGISTRY}/${IMAGE_NAME}:main" . + - name: Push Docker image + run: docker push "${REGISTRY}/${IMAGE_NAME}:main"