Skip to content

Update Docker image versions #69

Update Docker image versions

Update Docker image versions #69

name: build-rails-buildpack
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- ruby: '3.2.6'
folder: '3.x' # bookworm for linux/amd64
tag: '3.2.6-bookworm@sha256:9f7f699c7fdd0fb44378ae80f9ac3af15908f5ae74ecb714f25ac4225453a7ea'
- ruby: '3.3.6'
folder: '3.x' # bookworm for linux/amd64
tag: '3.3.6-bookworm@sha256:24a180b1727b169cdfab0acc2b2b70acaa1eca050e5379297eeaf7aa58e8416a'
- ruby: '3.4.1'
folder: '3.x' # bookworm for linux/amd64
tag: '3.4.1-bookworm@sha256:45ca46a37e16d4f0b383ff6f400edc7e096361ac05c91ead86481ecc332e665e'
container:
image: docker:git
env:
DOCKER_REPOSITORY: public.ecr.aws/degica/rails-buildpack
DOCKER_BUILDKIT: '1'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
runs-on: ubuntu-latest
steps:
- name: prepare
run: |-
apk add --no-cache python3 py3-pip
pip3 install --break-system-packages --upgrade pip
pip3 install --break-system-packages awscli
- name: workaround git security
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v3
- name: setup
run: git submodule update --init
- name: build_and_push
run: |-
cd rails-buildpack/${{ matrix.folder }}
if [[ ${GITHUB_REF##*/} == 'master' ]]; then
IMAGE_TAG=${{ matrix.ruby }}
else
IMAGE_TAG=test-${GITHUB_REF##*/}-${{ matrix.ruby }} # branch name for dev usecases
fi
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/degica
docker build . -t $DOCKER_REPOSITORY:$IMAGE_TAG --build-arg RUBY_TAG=${{ matrix.tag }} --pull
docker images
docker push $DOCKER_REPOSITORY:$IMAGE_TAG
docker tag $DOCKER_REPOSITORY:$IMAGE_TAG $DOCKER_REPOSITORY:latest
docker push $DOCKER_REPOSITORY:latest
'on':
push:
branches:
- '*'