Skip to content

Commit 050eeb1

Browse files
authored
chore: Update Docker build and push actions (#1790)
1 parent 6ccf4d6 commit 050eeb1

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

.github/workflows/container.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ jobs:
2323
- name: Set up QEMU
2424
uses: docker/setup-qemu-action@v3
2525

26-
# Login to Docker Hub
27-
- name: Login to Docker Hub
28-
uses: docker/login-action@v3
29-
with:
30-
username: ${{ secrets.DOCKERHUB_USERNAME }}
31-
password: ${{ secrets.DOCKERHUB_TOKEN }}
32-
3326
# Log in to GitHub Container Registry
3427
- name: Log in to GitHub Container Registry
3528
uses: docker/login-action@v2
@@ -50,7 +43,6 @@ jobs:
5043
with:
5144
images: |
5245
ghcr.io/${{ github.repository_owner }}/librechat-api
53-
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat-api
5446
tags: |
5547
type=raw,value=latest
5648
type=semver,pattern={{version}}
@@ -74,7 +66,6 @@ jobs:
7466
with:
7567
images: |
7668
ghcr.io/${{ github.repository_owner }}/librechat
77-
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat
7869
tags: |
7970
type=raw,value=latest
8071
type=semver,pattern={{version}}
@@ -89,4 +80,4 @@ jobs:
8980
push: true
9081
tags: ${{ steps.meta-librechat.outputs.tags }}
9182
platforms: linux/amd64,linux/arm64
92-
target: node
83+
target: node

.github/workflows/latest-images-main.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: Docker Compose Build on Main Branch
1+
name: Docker Compose Build on Tag
22

3+
# The workflow is manually triggered
34
on:
4-
workflow_dispatch: # This line allows manual triggering
5+
workflow_dispatch:
56

67
jobs:
78
build:
@@ -12,21 +13,20 @@ jobs:
1213
- name: Checkout
1314
uses: actions/checkout@v4
1415

16+
# Fetch all tags and set the latest tag
17+
- name: Fetch tags and set the latest tag
18+
run: |
19+
git fetch --tags
20+
echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
21+
1522
# Set up Docker
1623
- name: Set up Docker
1724
uses: docker/setup-buildx-action@v3
1825

19-
# Set up QEMU for cross-platform builds
26+
# Set up QEMU
2027
- name: Set up QEMU
2128
uses: docker/setup-qemu-action@v3
2229

23-
# Login to Docker Hub
24-
- name: Login to Docker Hub
25-
uses: docker/login-action@v3
26-
with:
27-
username: ${{ secrets.DOCKERHUB_USERNAME }}
28-
password: ${{ secrets.DOCKERHUB_TOKEN }}
29-
3030
# Log in to GitHub Container Registry
3131
- name: Log in to GitHub Container Registry
3232
uses: docker/login-action@v2
@@ -37,23 +37,21 @@ jobs:
3737

3838
# Prepare Docker Build
3939
- name: Build Docker images
40-
run: |
41-
cp .env.example .env
40+
run: cp .env.example .env
4241

43-
# Tag and push librechat-api
42+
# Docker metadata for librechat-api
4443
- name: Docker metadata for librechat-api
4544
id: meta-librechat-api
4645
uses: docker/metadata-action@v5
4746
with:
48-
images: |
49-
ghcr.io/${{ github.repository_owner }}/librechat-api
50-
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat-api
47+
images: ghcr.io/${{ github.repository_owner }}/librechat-api
5148
tags: |
52-
type=raw,value=latest
49+
type=raw,value=${{ env.LATEST_TAG }}
5350
type=semver,pattern={{version}}
5451
type=semver,pattern={{major}}
5552
type=semver,pattern={{major}}.{{minor}}
5653
54+
# Build and push librechat-api
5755
- name: Build and push librechat-api
5856
uses: docker/build-push-action@v5
5957
with:
@@ -64,20 +62,19 @@ jobs:
6462
platforms: linux/amd64,linux/arm64
6563
target: api-build
6664

67-
# Tag and push librechat
65+
# Docker metadata for librechat
6866
- name: Docker metadata for librechat
6967
id: meta-librechat
7068
uses: docker/metadata-action@v5
7169
with:
72-
images: |
73-
ghcr.io/${{ github.repository_owner }}/librechat
74-
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/librechat
70+
images: ghcr.io/${{ github.repository_owner }}/librechat
7571
tags: |
76-
type=raw,value=latest
72+
type=raw,value=${{ env.LATEST_TAG }}
7773
type=semver,pattern={{version}}
7874
type=semver,pattern={{major}}
7975
type=semver,pattern={{major}}.{{minor}}
8076
77+
# Build and push librechat
8178
- name: Build and push librechat
8279
uses: docker/build-push-action@v5
8380
with:

0 commit comments

Comments
 (0)