From 88b55b01fcbab0fbbc5b8032a38d0345af98ecfa Mon Sep 17 00:00:00 2001 From: Hugues Chocart Date: Sun, 4 Aug 2024 17:16:38 +0200 Subject: [PATCH] ci: add ml image in release (#469) --- .github/workflows/update-ml.yml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/update-ml.yml diff --git a/.github/workflows/update-ml.yml b/.github/workflows/update-ml.yml new file mode 100644 index 00000000..956227f7 --- /dev/null +++ b/.github/workflows/update-ml.yml @@ -0,0 +1,42 @@ +name: Build and push ml image + +on: + release: + types: [published] + +jobs: + build-push: + runs-on: ubuntu-latest + steps: + - name: Check out the private ml repo + uses: actions/checkout@v4 + with: + repository: lunary/ml + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "lunary/lunary" + + - name: Remove 'v' prefix from release tag + id: release_tag + run: echo "tag=$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')" >> $GITHUB_OUTPUT + + - name: Build and push ml + uses: docker/build-push-action@v5 + with: + push: true + tags: | + lunary/ml:latest + lunary/ml:${{ steps.release_tag.outputs.tag }} + platforms: linux/arm64,linux/amd64 + cache-from: type=gha + cache-to: type=gha,mode=max