upstream_commit #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |