Skip to content

Add selenium/standalone-chrome 4.27.0 to ECR cache #65

Add selenium/standalone-chrome 4.27.0 to ECR cache

Add selenium/standalone-chrome 4.27.0 to ECR cache #65

name: build-rails-base
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- ruby: '3.2.4'
folder: '3.1.x' # slim bookworm for linux/amd64
tag: '3.2.4-slim@sha256:3752526bb16284b5c8d5e45f2f83bae175e92cace720859d9e04700530392aa2'
- ruby: '3.3.1'
folder: '3.1.x' # slim bookworm for linux/amd64
tag: '3.3.1-slim-bookworm@sha256:25ee093f9d3405b4eb6c94b760160293314355c5255ef7974027d1d3d5a33e5f'
- ruby: '3.4.0'
folder: '3.1.x' # slim bookworm for linux/amd64
tag: '3.4.0-preview1-slim-bookworm@sha256:9a577e3528a9d13c6ad5ee9838409f64ad6ad1d9d98d54241e6ec85e38da5d34'
container:
image: docker:git
env:
DOCKER_REPOSITORY: public.ecr.aws/degica/rails-base
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-base/${{ 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:
- '*'