-
Notifications
You must be signed in to change notification settings - Fork 6
42 lines (40 loc) · 1.41 KB
/
build-run-pack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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:
- '*'