Skip to content

Merge pull request #818 from degica/revert_bastion_ami #302

Merge pull request #818 from degica/revert_bastion_ami

Merge pull request #818 from degica/revert_bastion_ami #302

name: build-run-pack
jobs:
build:
container:
image: docker:git
env:
DOCKER_REPOSITORY: public.ecr.aws/degica/barcelona-run-pack
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: workaround
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: prepare
run: |-
apk add --no-cache python3 py3-pip
find /usr/lib/ -type f -name 'EXTERNALLY-MANAGED' -delete
pip3 install --upgrade pip
pip3 install awscli
- uses: actions/checkout@v3
- name: setup
run: git submodule update --init
- name: build_and_push
run: |-
if [[ ${GITHUB_REF##*/} == 'master' ]]; then
IMAGE_TAG="latest" # update the latest image when master is merged
else
IMAGE_TAG=${GITHUB_REF##*/} # branch name for dev usecases
fi
cd dockerfiles/run-pack
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 git_revision=$IMAGE_TAG --pull
docker images
docker push $DOCKER_REPOSITORY:$IMAGE_TAG
'on':
push:
branches:
- '*'