Skip to content

Commit b23b92d

Browse files
committed
Adds GitHub Actions to publish full and light Docker images on tag.
1 parent 50051dc commit b23b92d

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ jobs:
201201
publish-docker:
202202
name: Publish Docker Image
203203
runs-on: ubuntu-latest
204-
needs: [build-arm64, build-intel, build-windows, build-linux] # Ensure all desktop builds are done
204+
needs: [release] # Depend on 'release' job to ensure artifacts are uploaded and version is stable
205205
steps:
206206
- name: Checkout repository
207207
uses: actions/checkout@v4
@@ -212,18 +212,43 @@ jobs:
212212
username: ${{ secrets.DOCKER_USERNAME }}
213213
password: ${{ secrets.DOCKER_PASSWORD }}
214214

215-
- name: Extract Docker metadata
216-
id: meta
217-
uses: docker/metadata-action@v5
215+
- name: Get version from Git tag
216+
id: get_version
217+
run: |
218+
VERSION="${{ github.ref_name }}"
219+
VERSION="${VERSION#v}" # Remove leading 'v'
220+
MAJOR_VERSION=$(echo "$VERSION" | cut -d. -f1)
221+
echo "VERSION=$VERSION" >> $GITHUB_ENV
222+
echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV
223+
echo "Extracted VERSION: $VERSION"
224+
echo "Extracted MAJOR_VERSION: $MAJOR_VERSION"
225+
226+
# --- Build and push FULL image (with WhisperX) ---
227+
- name: Build and push FULL Docker image
228+
uses: docker/build-push-action@v5
218229
with:
219-
images: gandulf78/podcast_generator
230+
context: .
231+
push: true
232+
target: with_whisperx # Assuming this is the target for the full version
220233
tags: |
221-
type=ref,event=tag # Use the Git tag (e.g., v1.0.0) as the Docker tag
222-
223-
- name: Build and push Docker image
234+
gandulf78/podcast_generator:${{ env.VERSION }}
235+
gandulf78/podcast_generator:${{ env.MAJOR_VERSION }}
236+
gandulf78/podcast_generator:latest
237+
labels: |
238+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
239+
org.opencontainers.image.version=${{ env.VERSION }}
240+
241+
# --- Build and push LIGHT image (without WhisperX) ---
242+
- name: Build and push LIGHT Docker image
224243
uses: docker/build-push-action@v5
225244
with:
226245
context: .
227246
push: true
228-
tags: ${{ steps.meta.outputs.tags }}
229-
labels: ${{ steps.meta.outputs.labels }}
247+
target: without_whisperx # Assuming this is the target for the light version
248+
tags: |
249+
gandulf78/podcast_generator:${{ env.VERSION }}-light
250+
gandulf78/podcast_generator:${{ env.MAJOR_VERSION }}-light
251+
gandulf78/podcast_generator:light
252+
labels: |
253+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
254+
org.opencontainers.image.version=${{ env.VERSION }}-light

0 commit comments

Comments
 (0)