Skip to content

ci: switch to latest aws-cdk for best build #58

ci: switch to latest aws-cdk for best build

ci: switch to latest aws-cdk for best build #58

Workflow file for this run

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: Check release status
id: release-status
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install python-semantic-release
if semantic-release --noop --strict version
then
echo "Releasing new version."
else
echo "Skipping release steps."
fi
- name: Python Semantic Release
id: semantic
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: docker push version
run: |
export RELEASE_VERSION=$(echo ${{ steps.release-status.outputs.tag }} | cut -c 2-)
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 .
push_readme_to_dockerhub:
runs-on: ubuntu-latest
name: Push README to Docker Hub
steps:
- name: git checkout
uses: actions/checkout@v2
- name: push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
with:
destination_container_repo: mbari/fastapi-yolov5:latest
provider: dockerhub
short_description: 'YOLOv5 Machine Learning API powered by the FastAPI framework'
readme_file: 'README.md'