forked from Cloud-CV/EvalAI
-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (65 loc) · 2.56 KB
/
build.yaml
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
56
57
58
59
60
61
62
63
64
65
name: arenas-build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os:
- ubuntu-20.04
python-version:
- 3.7.17
env:
TRAVIS_PULL_REQUEST: ${{ vars.TRAVIS_PULL_REQUEST }}
TRAVIS_BRANCH: ${{ vars.TRAVIS_BRANCH }}
DEPLOY_FLAG: ${{ vars.DEPLOY_FLAG }}
PRODUCTION_INSTANCE: ${{ secrets.PRODUCTION_INSTANCE }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
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 }}
steps:
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python-version }}'
- run: rm -f $HOME/.cache/pip/log/debug.log
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: $HOME/.cache/pip
key: '${{ runner.os }}-${{ hashFiles(''TODO'') }}'
- uses: actions/checkout@v2
- run: sudo rm -f /etc/boto.cfg
- run: export CHROME_BIN=chromium-browser
- run: export DISPLAY=:99.0
- run: pip install awscli==1.18.66 importlib-metadata==4.8.3 flake8==3.8.4 coveralls==3.3.1
- run: flake8 ./ || exit 1;
# - run: >-
# if [ $TRAVIS_PULL_REQUEST = false ]; then echo $DOCKER_PASSWORD
# | docker login --username $DOCKER_USERNAME --password-stdin ||
# exit 1; fi
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to ECR
uses: docker/login-action@v3
with:
registry: ${{ secrets.AWS_REGISTRY }}
- run: docker-compose build || exit 1;
- run: docker-compose run -e DJANGO_SETTINGS_MODULE=settings.test django pytest --cov . --cov-config .coveragerc || exit 1;
- run: 'bash <(curl -s https://codecov.io/bash)'
- run: coveralls --rcfile=.coveragerc
- run: eval "$(ssh-agent -s)"
- run: openssl enc -d -aes-256-cbc -K ${{ secrets.ENCRYPTED_KEY }} -iv ${{ secrets.ENCRYPTED_IV }} -in scripts/deployment/evalai.pem.enc -out scripts/deployment/evalai.pem || true
- run: ./scripts/deployment/push.sh
- run: ./scripts/deployment/deploy.sh ${{ vars.DEPLOY_FLAG }}