-
Notifications
You must be signed in to change notification settings - Fork 53
53 lines (44 loc) · 1.34 KB
/
deployment.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
name: Deploy Model on AWS Sagemaker
on:
deployment
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set Tag in Environment
id: set-aws-tag
run: |
if [ -z "$GITHUB_REF" ]
then
echo "No Tag given. Workflow may only be run on tagged commits."
exit 1
fi
echo "::set-output name=awstag::$(echo ${GITHUB_REF:10} | sed 's/[^a-zA-Z0-9]/-/g')"
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install click==7.0
pip install boto3==1.10.28
pip install mlflow==1.4.0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Deploy model on AWS Sagemaker
id: deploy-model
env:
AWS_TAG: ${{ steps.set-aws-tag.outputs.awstag }}
run: |
make sagemaker_deploy JOB_ID="ml-ids-sagemaker-$AWS_TAG"