nsarrazin HF staff commited on
Commit
ebac27c
1 Parent(s): 9437108

Publish docker images based on package.json version (#988)

Browse files

* Publish docker images based on package.json version

* fix build image

Files changed (1) hide show
  1. .github/workflows/build-image.yml +9 -4
.github/workflows/build-image.yml CHANGED
@@ -1,4 +1,4 @@
1
- name: Buid and Publish Image
2
 
3
  on:
4
  push:
@@ -20,6 +20,12 @@ jobs:
20
  steps:
21
  - name: Checkout
22
  uses: actions/checkout@v4
 
 
 
 
 
 
23
  - name: Docker metadata
24
  id: meta
25
  uses: docker/metadata-action@v5
@@ -27,10 +33,9 @@ jobs:
27
  images: |
28
  ghcr.io/huggingface/chat-ui-db
29
  tags: |
 
30
  type=raw,value=latest,enable={{is_default_branch}}
31
- type=semver,pattern={{version}}
32
- type=semver,pattern={{major}}
33
- type=semver,pattern={{major}}.{{minor}}
34
 
35
  - name: Set up QEMU
36
  uses: docker/setup-qemu-action@v3
 
1
+ name: Build and Publish Image
2
 
3
  on:
4
  push:
 
20
  steps:
21
  - name: Checkout
22
  uses: actions/checkout@v4
23
+
24
+ - name: Extract package version
25
+ id: package-version
26
+ run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
27
+ if: github.event_name == 'release'
28
+
29
  - name: Docker metadata
30
  id: meta
31
  uses: docker/metadata-action@v5
 
33
  images: |
34
  ghcr.io/huggingface/chat-ui-db
35
  tags: |
36
+ type=semver,value=${{ steps.package-version.outputs.version }},enable={{github.event_name == 'release'}}
37
  type=raw,value=latest,enable={{is_default_branch}}
38
+ type=sha,enable={{is_default_branch}}
 
 
39
 
40
  - name: Set up QEMU
41
  uses: docker/setup-qemu-action@v3