From eff57dad190b3f14d3df770898b119e3599f09d8 Mon Sep 17 00:00:00 2001 From: Josh XT Date: Mon, 29 Jul 2024 20:11:54 -0400 Subject: [PATCH] add cu123 build --- .github/workflows/publish-docker-cuda.yml | 58 +++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/publish-docker-cuda.yml diff --git a/.github/workflows/publish-docker-cuda.yml b/.github/workflows/publish-docker-cuda.yml new file mode 100644 index 0000000..22577b9 --- /dev/null +++ b/.github/workflows/publish-docker-cuda.yml @@ -0,0 +1,58 @@ +name: Build and Test + +on: + push: + branches: [main] + release: + types: [published] + workflow_dispatch: + +jobs: + build-ezlocalai: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Extract GitHub info + run: | + echo "ORG_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 1 | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + echo "GITHUB_USER=$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 2 | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + id: extract_branch + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ env.GITHUB_USER }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + push: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: | + ${{ vars.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}:cu123 + ghcr.io/${{ env.ORG_NAME }}/${{ env.REPO_NAME }}:cu123 + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ vars.DOCKERHUB_USERNAME }}/ezlocalai