Skip to content

improve readme a bit #58

improve readme a bit

improve readme a bit #58

name: build-rails-buildpack
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- ruby: '3.1.4'
folder: '3.1.x' # buster
tag: '3.1.4@sha256:18d450c9a5c573b2eeedc04cccf2d69a778b12d7e5f0b9caedf8b88abd7701eb'
- ruby: '3.2.1'
folder: '3.1.x' # buster
tag: '3.2.1@sha256:96a985d0ef955b77f3ecff795a7294629e2b8e0c12644c5b73ed817845f11919'
- ruby: '3.2.2'
folder: '3.1.x' # bullseye
tag: '3.2.2@sha256:139ee8e0f51fdd5d4b291d0755287e4ef3b9e58a0a78cb054e9a9c2a68a1daa6'
- ruby: '3.2.3'
folder: '3.1.x' # bookworm
tag: '3.2.3@sha256:5590025acebb13cacd5a5a4e5b0733c18d841318b8b788996bb88ce1fc64c565'
- ruby: '3.2.4'
folder: '3.1.x' # bookworm for linux/amd64
tag: '3.2.4@sha256:cf386d39f6a0fd0431a02bd1bb4acfa90673f763137ecb829875f9a3d9c26c5a'
- ruby: '3.3.0-preview1'
folder: '3.1.x' # bookworm
tag: '3.3.0-preview1@sha256:4eb0a0d89cac283399a31ab7c690e91e39de9eb836452ef48bc6f9b30f61854d'
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:
- '*'