From 29ee4423a60449ff12d5b1846e85b1d8887a94b3 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 16 Feb 2024 15:37:32 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8B=20chore:=20Add=20Docker=20Compose?= =?UTF-8?q?=20Build=20Latest=20Main=20Image=20workflow=20(#1819)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main-image-workflow.yml | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/main-image-workflow.yml diff --git a/.github/workflows/main-image-workflow.yml b/.github/workflows/main-image-workflow.yml new file mode 100644 index 0000000000..37c9bed312 --- /dev/null +++ b/.github/workflows/main-image-workflow.yml @@ -0,0 +1,50 @@ +name: Docker Compose Build Latest Main Image (Manual Dispatch) + +# The workflow is manually triggered +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Fetch tags and set the latest tag + run: | + git fetch --tags + echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV + + - name: Set up Docker + uses: docker/setup-buildx-action@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker metadata for librechat + id: meta-librechat + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/librechat + tags: | + type=raw,value=${{ env.LATEST_TAG }},enable=true + type=raw,value=latest,enable=true + type=semver,pattern={{version}} + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + + - name: Retry Build and Push librechat + uses: nick-invision/retry@v3 + with: + timeout_minutes: 20 # Total time to attempt retries + max_attempts: 3 # Number of retry attempts + command: docker buildx build --file Dockerfile --push --tags ${{ steps.meta-librechat.outputs.tags }} --platform linux/amd64,linux/arm64 --target node .