-
Notifications
You must be signed in to change notification settings - Fork 14
58 lines (48 loc) · 1.63 KB
/
docker.yml
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
name: CI
on:
push:
branches:
- master
paths:
- Dockerfile
- .dockerignore
- .github/workflows/docker.yml
repository_dispatch:
# this event is submited via github.com/bots-house/github-actions-upstream-watch
types: upstream_commit
jobs:
build:
name: Build Image
runs-on: ubuntu-latest
steps:
- name: Checkout current repo
uses: actions/checkout@v2
- name: Checkout upstream repo
uses: actions/checkout@v2
with:
repository: tdlib/telegram-bot-api
path: upstream
submodules: recursive
- name: Get Version
run: |
# get telegram bot api version
telegram_bot_api_version=$(cd upstream && git rev-parse --short HEAD)
# get tdlib version
tdlib_version=$(cd upstream/td && git rev-parse --short HEAD)
# concat tdlib and telegram bot api version
version=$telegram_bot_api_version-$tdlib_version
# store variable for future use
echo "version=$version" >> $GITHUB_ENV
- name: Build image
run: |
docker build \
--tag ghcr.io/bots-house/docker-telegram-bot-api:latest \
--tag ghcr.io/bots-house/docker-telegram-bot-api:$version \
.
- name: Login to registry
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Push images
run: |
docker push ghcr.io/bots-house/docker-telegram-bot-api:latest
docker push ghcr.io/bots-house/docker-telegram-bot-api:$version