-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (46 loc) · 1.91 KB
/
docker-image.yml
File metadata and controls
55 lines (46 loc) · 1.91 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
name: Docker Image CI (Dev)
on:
push:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate version
id: version
run: |
# Generate dev version: 0.0.0-dev.YYYYMMDD.HHMMSS.shortsha
DATE_VERSION=$(date +%Y%m%d.%H%M%S)
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
VERSION="0.0.0-dev.${DATE_VERSION}.${SHORT_SHA}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Generated version: $VERSION"
- 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:dev_$VERSION \
--tag ghcr.io/mateof/telegramfilemanager:dev_latest
docker push ghcr.io/mateof/telegramfilemanager:dev_$VERSION
docker push ghcr.io/mateof/telegramfilemanager:dev_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:dev_$VERSION-lite \
--tag ghcr.io/mateof/telegramfilemanager:dev_latest-lite
docker push ghcr.io/mateof/telegramfilemanager:dev_$VERSION-lite
docker push ghcr.io/mateof/telegramfilemanager:dev_latest-lite