-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (52 loc) · 1.66 KB
/
build-reverse-proxy.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
43
44
45
46
47
48
49
50
51
52
53
54
55
name: build-reverse-proxy
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: startup
run: |
cd dockerfiles/reverse-proxy
docker-compose -f docker-compose.test.yml up --build -d
- name: test
run: |
sleep 10
curl http://localhost:50132
build:
needs: test
container:
image: docker:git
env:
DOCKER_REPOSITORY: public.ecr.aws/degica/barcelona-reverse-proxy
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-22.04
steps:
- name: workaround
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: prepare
run: |-
apk add --no-cache python3 py3-pip
pip3 install --upgrade pip
pip3 install awscli
- uses: actions/checkout@v2
- 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/reverse-proxy
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:
- '*'