-
Notifications
You must be signed in to change notification settings - Fork 6
63 lines (54 loc) · 2.12 KB
/
release-docker-image.yml
File metadata and controls
63 lines (54 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Docker Image CI (Release)
# Triggers:
# - Push tags: server-v* OR v* (but NOT app-v*)
# Docker is only built for Server releases
on:
push:
tags:
- 'v*.*.*'
- 'server-v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
# Skip if it's an app-only release
if: ${{ !startsWith(github.ref_name, 'app-v') }}
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: |
TAG=${GITHUB_REF_NAME}
# Remove 'server-v' or 'v' prefix
VERSION=${TAG#server-v}
VERSION=${VERSION#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Extracted version: $VERSION from tag: $TAG"
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GHCR}}
- name: Build and Push Full Image (with FFmpeg)
run: |
VERSION=${{ steps.version.outputs.version }}
echo "Building full image with FFmpeg support..."
docker build ./TelegramDownloader -f ./TelegramDownloader/Dockerfile \
--build-arg VERSION=$VERSION \
--build-arg INCLUDE_FFMPEG=true \
--tag ghcr.io/mateof/telegramfilemanager:${{github.ref_name}} \
--tag ghcr.io/mateof/telegramfilemanager:latest
docker push ghcr.io/mateof/telegramfilemanager:${{github.ref_name}}
docker push ghcr.io/mateof/telegramfilemanager:latest
- name: Build and Push Lite Image (without FFmpeg)
run: |
VERSION=${{ steps.version.outputs.version }}
echo "Building lite image without FFmpeg..."
docker build ./TelegramDownloader -f ./TelegramDownloader/Dockerfile \
--build-arg VERSION=$VERSION \
--build-arg INCLUDE_FFMPEG=false \
--tag ghcr.io/mateof/telegramfilemanager:${{github.ref_name}}-lite \
--tag ghcr.io/mateof/telegramfilemanager:latest-lite
docker push ghcr.io/mateof/telegramfilemanager:${{github.ref_name}}-lite
docker push ghcr.io/mateof/telegramfilemanager:latest-lite