From d55d0dca19dc1bb4e107fd4842451936ede0e9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Thu, 10 Jun 2021 16:18:33 +0200 Subject: [PATCH] ci: attempt to configure docker build using gh actions --- .github/workflows/docker.yml | 41 ++++++++++++++++++++++++++++++++++++ README.md | 1 - 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..bb0df91 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,41 @@ +name: Publish Docker Image + +on: + push: + tags: + - '*.*.*' + - '!*.*.*-*' + +jobs: + docker-publish: + runs-on: ubuntu-latest + steps: + # https://stackoverflow.com/questions/58177786 + - name: Get version + run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push to Docker Hub + uses: docker/build-push-action@v2 + with: + push: true + tags: | + n1try/webhook2telegram:${{ env.GIT_TAG }} + n1try/webhook2telegram:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file diff --git a/README.md b/README.md index 43d9512..4fa11a1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ (formerly _telegram-middleman-bot_) [![](http://img.shields.io/liberapay/receives/muety.svg?logo=liberapay)](https://liberapay.com/muety/) -[![Say thanks](https://badges.fw-web.space/badge/SayThanks.io-%E2%98%BC-1EAEDB.svg)](https://saythanks.io/to/n1try) ![](https://badges.fw-web.space/github/license/muety/webhook2telegram) ![Coding Activity](https://badges.fw-web.space/endpoint?url=https://wakapi.dev/api/compat/shields/v1/n1try/interval:any/project:webhook2telegram&color=blue) [![Go Report Card](https://goreportcard.com/badge/github.com/muety/webhook2telegram)](https://goreportcard.com/report/github.com/muety/telegram-middleman-bot)