mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-11-26 21:56:49 +01:00
github actions attempt
This commit is contained in:
parent
38ec055387
commit
6eb664a608
52
.github/workflows/docker.yml
vendored
Normal file
52
.github/workflows/docker.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: Docker Build + Image Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Image
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
IMAGE_id: docker.pkg.github.com/${{ github.repository }}/${{ github.repository }}
|
||||
|
||||
steps:
|
||||
- name: Checkout current repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Get Version
|
||||
run: |
|
||||
# get telegram bot api version
|
||||
telegram_bot_api_version=$(git rev-parse --short HEAD)
|
||||
|
||||
# get tdlib version
|
||||
tdlib_version=$(cd 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: |
|
||||
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/${{ github.repository }}
|
||||
docker build \
|
||||
--tag tdlight-team/tdlight-telegram-bot-api:latest \
|
||||
--tag tdlight-team/tdlight-telegram-bot-api:$version \
|
||||
.
|
||||
|
||||
- name: Login to registry
|
||||
run: |
|
||||
echo "${{ secrets.GITHUB_ACCESS_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
||||
|
||||
|
||||
- name: Push images
|
||||
run: |
|
||||
docker push $IMAGE_ID:$version
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM alpine:3.12.1 as builder
|
||||
|
||||
RUN apk --no-cache add \
|
||||
build-base \
|
||||
cmake \
|
||||
openssl-dev \
|
||||
zlib-dev \
|
||||
gperf \
|
||||
linux-headers
|
||||
|
||||
COPY . /src
|
||||
|
||||
WORKDIR /src/build
|
||||
|
||||
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
RUN cmake --build . --target install --
|
||||
|
||||
FROM alpine:3.12.1
|
||||
|
||||
RUN apk --no-cache add libstdc++
|
||||
|
||||
COPY --from=builder /usr/local/bin/telegram-bot-api /usr/local/bin/telegram-bot-api
|
||||
|
||||
HEALTHCHECK CMD curl -f http://localhost:8082/ || exit 1
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/telegram-bot-api -s 8082"]
|
Loading…
Reference in New Issue
Block a user