From dcc73dfc81639d408fb3727bec053d0a514a57a2 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 18 Jul 2021 19:55:15 +0200 Subject: [PATCH] setup action to build/publish on docker hub --- .github/workflows/publish.yml | 29 +++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0ed948c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,29 @@ +name: Publish Docker image + +on: + push: + branches: + - 'master' + - 'devel' + tags: + - 'v*' + +jobs: + docker-hub: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: docker/metadata-action@v3 + id: meta + with: + images: nim65s/matrix-webhook + - uses: docker/login-action@v1 + with: + username: nim65s + password: ${{ secrets.DOCKERHUB_TOKEN }} + - uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/README.md b/README.md index d9517ed..29a19cc 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Tests](https://github.com/nim65s/matrix-webhook/actions/workflows/test.yml/badge.svg)](https://github.com/nim65s/matrix-webhook/actions/workflows/test.yml) [![Lints](https://github.com/nim65s/matrix-webhook/actions/workflows/lint.yml/badge.svg)](https://github.com/nim65s/matrix-webhook/actions/workflows/lint.yml) +[![Publish](https://github.com/nim65s/matrix-webhook/actions/workflows/publish.yml/badge.svg)](https://github.com/nim65s/matrix-webhook/actions/workflows/publish.yml) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![codecov](https://codecov.io/gh/nim65s/matrix-webhook/branch/master/graph/badge.svg?token=BLGISGCYKG)](https://codecov.io/gh/nim65s/matrix-webhook)