1
- name : Docker Compose Build on Main Branch
1
+ name : Docker Compose Build on Tag
2
2
3
+ # The workflow is manually triggered
3
4
on :
4
- workflow_dispatch : # This line allows manual triggering
5
+ workflow_dispatch :
5
6
6
7
jobs :
7
8
build :
@@ -12,21 +13,20 @@ jobs:
12
13
- name : Checkout
13
14
uses : actions/checkout@v4
14
15
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
+
15
22
# Set up Docker
16
23
- name : Set up Docker
17
24
uses : docker/setup-buildx-action@v3
18
25
19
- # Set up QEMU for cross-platform builds
26
+ # Set up QEMU
20
27
- name : Set up QEMU
21
28
uses : docker/setup-qemu-action@v3
22
29
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
-
30
30
# Log in to GitHub Container Registry
31
31
- name : Log in to GitHub Container Registry
32
32
uses : docker/login-action@v2
@@ -37,23 +37,21 @@ jobs:
37
37
38
38
# Prepare Docker Build
39
39
- name : Build Docker images
40
- run : |
41
- cp .env.example .env
40
+ run : cp .env.example .env
42
41
43
- # Tag and push librechat-api
42
+ # Docker metadata for librechat-api
44
43
- name : Docker metadata for librechat-api
45
44
id : meta-librechat-api
46
45
uses : docker/metadata-action@v5
47
46
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
51
48
tags : |
52
- type=raw,value=latest
49
+ type=raw,value=${{ env.LATEST_TAG }}
53
50
type=semver,pattern={{version}}
54
51
type=semver,pattern={{major}}
55
52
type=semver,pattern={{major}}.{{minor}}
56
53
54
+ # Build and push librechat-api
57
55
- name : Build and push librechat-api
58
56
uses : docker/build-push-action@v5
59
57
with :
@@ -64,20 +62,19 @@ jobs:
64
62
platforms : linux/amd64,linux/arm64
65
63
target : api-build
66
64
67
- # Tag and push librechat
65
+ # Docker metadata for librechat
68
66
- name : Docker metadata for librechat
69
67
id : meta-librechat
70
68
uses : docker/metadata-action@v5
71
69
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
75
71
tags : |
76
- type=raw,value=latest
72
+ type=raw,value=${{ env.LATEST_TAG }}
77
73
type=semver,pattern={{version}}
78
74
type=semver,pattern={{major}}
79
75
type=semver,pattern={{major}}.{{minor}}
80
76
77
+ # Build and push librechat
81
78
- name : Build and push librechat
82
79
uses : docker/build-push-action@v5
83
80
with :
0 commit comments