Skip to content

Commit

Permalink
Update github actions to use ubuntu-22.04 and use old actions file
Browse files Browse the repository at this point in the history
  • Loading branch information
Freika committed Feb 6, 2025
1 parent ebd4694 commit 9837c09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 31 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || github.ref_name }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down Expand Up @@ -60,12 +61,12 @@ jobs:
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v6
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile.dev
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
cache-to: type=local,dest=/tmp/.buildx-cache
39 changes: 11 additions & 28 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.4.1-bookworm
FROM ruby:3.4.1-alpine

ENV APP_PATH=/var/app
ENV BUNDLE_VERSION=2.5.21
Expand All @@ -8,29 +8,20 @@ ENV RAILS_PORT=3000
ENV RAILS_ENV=development

# Install dependencies for application
RUN dpkg --add-architecture arm64 && \
apt-get update && apt-get install -y \
build-essential \
RUN apk -U add --no-cache \
build-base \
git \
postgresql-client:arm64 \
libpq-dev:arm64 \
libpq5:arm64 \
postgresql-dev \
postgresql-client \
libxml2-dev \
libxslt-dev \
nodejs \
npm \
yarn \
imagemagick \
tzdata \
less \
libyaml-dev \
gcc \
g++ \
make \
libgeos-dev \
libproj-dev \
&& npm install -g yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
yaml-dev \
gcompat \
&& mkdir -p $APP_PATH

# Update gem system and install bundler
Expand All @@ -42,18 +33,10 @@ WORKDIR $APP_PATH

COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./

# Set environment variables for compilation
ENV CFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing" \
CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing" \
MAKEFLAGS="-j2" \
BUNDLE_FORCE_RUBY_PLATFORM="true"

# Install all gems into the image with reduced parallelism for ARM64
# Install all gems into the image
RUN bundle config set --local path 'vendor/bundle' \
&& bundle config set --local jobs 2 \
&& bundle config set build.nokogiri --use-system-libraries \
&& bundle install --retry 3 \
&& rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem
&& bundle install --jobs 4 --retry 3 \
&& rm -rf vendor/bundle/ruby/3.3.0/cache/*.gem

# Copy the rest of the application
COPY ../. ./
Expand Down

0 comments on commit 9837c09

Please sign in to comment.