From da1f1d35148381a1f1a937b251b64b723b1c0b5c Mon Sep 17 00:00:00 2001 From: Nameless Date: Mon, 26 Apr 2021 21:26:21 +0300 Subject: [PATCH] Build docker image in CI (#221) * Build docker image in CI * Build docker image on any branch temporarely * Update github actions * Update github actions * Update github actions * Update github actions * Update github actions * Update readme * Update github actions --- .github/workflows/main.yml | 13 +++++++++++++ Dockerfile | 2 +- readme.md | 11 +++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 174bbcd..76d8149 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,3 +31,16 @@ jobs: - name: Check formatting and run linters run: | sh check.sh + + - name: build and deploy master image to ghcr.io + # if: ${{ github.ref == 'refs/heads/master' }} + env: + PKG_TOKEN: ${{ secrets.PKG_TOKEN }} + USERNAME: ${{ github.actor }} + run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") + git_branch="$(echo ${GITHUB_REF} | cut -d'/' -f3)" + echo ${PKG_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin + docker build -t ghcr.io/${USERNAME}/tg:${git_branch}-${git_hash} -t ghcr.io/${USERNAME}/tg:latest . + docker push ghcr.io/${USERNAME}/tg:${git_branch}-${git_hash} + docker push ghcr.io/${USERNAME}/tg:latest diff --git a/Dockerfile b/Dockerfile index 35d4533..945737f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8.3-slim-buster +FROM python:3.9.4-slim-buster RUN pip install tg diff --git a/readme.md b/readme.md index 7df4b56..ac2f608 100644 --- a/readme.md +++ b/readme.md @@ -61,6 +61,13 @@ pip3 install tg tg ``` +### Homebrew + +```sh +brew tap paul-nameless/homebrew-repo +brew install tg +``` + ### From sources This option is recommended for development: @@ -75,10 +82,10 @@ tg ### Using Docker -> Please note that voice recordings and notifications won't work when using Docker. +> Note that voice recordings and notifications won't work when using Docker. ```sh -docker run -it --rm tg +docker run -it --rm ghcr.io/paul-nameless/tg ``` ### From the AUR