chore: Update Docker build and push actions (#1790)

This commit is contained in:
Danny Avila 2024-02-13 10:59:46 -05:00 committed by GitHub
parent 6ccf4d6ed2
commit 050eeb1211
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 32 deletions

View file

@ -23,13 +23,6 @@ jobs:
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
# Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Log in to GitHub Container Registry # Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
@ -50,7 +43,6 @@ jobs:
with: with:
images: | images: |
ghcr.io/${{ github.repository_owner }}/librechat-api ghcr.io/${{ github.repository_owner }}/librechat-api
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat-api
tags: | tags: |
type=raw,value=latest type=raw,value=latest
type=semver,pattern={{version}} type=semver,pattern={{version}}
@ -74,7 +66,6 @@ jobs:
with: with:
images: | images: |
ghcr.io/${{ github.repository_owner }}/librechat ghcr.io/${{ github.repository_owner }}/librechat
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat
tags: | tags: |
type=raw,value=latest type=raw,value=latest
type=semver,pattern={{version}} type=semver,pattern={{version}}

View file

@ -1,7 +1,8 @@
name: Docker Compose Build on Main Branch name: Docker Compose Build on Tag
# The workflow is manually triggered
on: on:
workflow_dispatch: # This line allows manual triggering workflow_dispatch:
jobs: jobs:
build: build:
@ -12,21 +13,20 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
# Fetch all tags and set the latest tag
- 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
# Set up Docker # Set up Docker
- name: Set up Docker - name: Set up Docker
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
# Set up QEMU for cross-platform builds # Set up QEMU
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
# Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Log in to GitHub Container Registry # Log in to GitHub Container Registry
- name: Log in to GitHub Container Registry - name: Log in to GitHub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
@ -37,23 +37,21 @@ jobs:
# Prepare Docker Build # Prepare Docker Build
- name: Build Docker images - name: Build Docker images
run: | run: cp .env.example .env
cp .env.example .env
# Tag and push librechat-api # Docker metadata for librechat-api
- name: Docker metadata for librechat-api - name: Docker metadata for librechat-api
id: meta-librechat-api id: meta-librechat-api
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: | images: ghcr.io/${{ github.repository_owner }}/librechat-api
ghcr.io/${{ github.repository_owner }}/librechat-api
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat-api
tags: | tags: |
type=raw,value=latest type=raw,value=${{ env.LATEST_TAG }}
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}} type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
# Build and push librechat-api
- name: Build and push librechat-api - name: Build and push librechat-api
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
@ -64,20 +62,19 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
target: api-build target: api-build
# Tag and push librechat # Docker metadata for librechat
- name: Docker metadata for librechat - name: Docker metadata for librechat
id: meta-librechat id: meta-librechat
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: | images: ghcr.io/${{ github.repository_owner }}/librechat
ghcr.io/${{ github.repository_owner }}/librechat
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat
tags: | tags: |
type=raw,value=latest type=raw,value=${{ env.LATEST_TAG }}
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}} type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
# Build and push librechat
- name: Build and push librechat - name: Build and push librechat
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with: