-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (52 loc) · 1.92 KB
/
release.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
56
57
58
59
60
61
62
name: New Release
on:
push:
branches:
- main
pull_request:
branches:
- main
# Support running these jobs manually
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install -r src/requirements.txt
pip install -r src/app/yolov5/requirements.txt
pip install awscli
- name: Download data
run: |
aws s3 cp --no-sign-request s3://902005-public/models/Megadetector/best.pt src/app/model/
aws s3 cp --no-sign-request s3://902005-public/models/Megadetector/labels.txt src/app/model/
- name: Set PYTHONPATH and Run Tests
env:
PYTHONPATH: src
run: pytest
semantic_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Python Semantic Release
id: semantic
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: docker push version
if: steps.release.outputs.released == 'true'
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker buildx create --name mybuilder --platform linux/amd64,linux/arm64 --use
docker buildx build --push --platform linux/amd64,linux/arm64 -t mbari/fastapi-yolov5-fargate-elb:$RELEASE_VERSION --label IMAGE_URI=mbari/fastapi-yolov5-fargate-elb:$RELEASE_VERSION -f Dockerfile.aws .
cd src && docker buildx build --push --platform linux/amd64,linux/arm64 -t mbari/fastapi-yolov5:$RELEASE_VERSION --label IMAGE_URI=mbari/fastapi-yolov5:$RELEASE_VERSION .