Skip to content

Commit

Permalink
Merge branch 'main' of http://github.com/mbari-org/fastapi-yolov5 int…
Browse files Browse the repository at this point in the history
…o main
  • Loading branch information
danellecline committed Mar 11, 2024
2 parents 0e14994 + a08d646 commit bd36854
Showing 1 changed file with 17 additions and 50 deletions.
67 changes: 17 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,60 +42,27 @@ jobs:
semantic_release:
runs-on: ubuntu-latest
name: Runs semantic release
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
- uses: actions/checkout@v3

- uses: codfish/[email protected]
id: semantic
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install commitizen @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/exec @semantic-release/changelog @semantic-release/npm @semantic-release/git
- name: Release
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
GIT_AUTHOR_NAME: danellecline
GIT_COMMITTER_NAME: danellecline
run: npx semantic-release

build:
name: docker build
needs: [ semantic_release ]
runs-on: ubuntu-latest
steps:
- name: Check out code and all tags and branches
uses: actions/checkout@v2
id: version
with:
fetch-depth: 0

- name: Get docker tag
- name: docker push version
if: steps.semantic.outputs.new-release-published == 'true'
run: |
tag_v=$(git describe --tags $(git rev-list --tags --max-count=1))
tag=$(echo $tag_v | sed 's/v//')
if [[ $tag =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
tag="latest"
fi
echo "Setting TAG=${tag}"
echo "TAG=${tag}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push to Docker Hub
uses: docker/build-push-action@v3
with:
context: src
push: true
tags: |
mbari/fastapi-yolov5:${{ env.TAG }}
mbari/fastapi-yolov5:latest
labels: |
IMAGE_URI=mbari/fastapi-yolov5
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:$RELEASE_VERSION --label IMAGE_URI=mbari/fastapi-yolov5:$RELEASE_VERSION -f src/Dockerfile .
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 .

0 comments on commit bd36854

Please sign in to comment.