Skip to content

build: switch to docker group #48

build: switch to docker group

build: switch to docker group #48

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
name: Runs semantic release
steps:
- uses: actions/checkout@v3
- uses: codfish/[email protected]
id: semantic
with:
dry-run: false
branches: |
['main']
additional-packages: |
['@semantic-release/git']
plugins: |
['@semantic-release/git', '@semantic-release/commit-analyzer', '@semantic-release/release-notes-generator', '@semantic-release/github', '@semantic-release/git']
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: 000000000000000
- name: docker push version
if: steps.semantic.outputs.new-release-published == '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 .