diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000..63a8813af7 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,23 @@ +name: Docker + +on: + workflow_dispatch: + push: + branches: + - develop + pull_request: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - run: make docker/build + - run: make docker/login + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + - name: docker push + if: github.ref == 'develop' + run: make docker/push diff --git a/Makefile b/Makefile index 6e30ee5936..2cf08b7537 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,9 @@ docker/pull: docker/build: docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) . +docker/login: + @echo $(DOCKERHUB_TOKEN) | docker login --username $(DOCKERHUB_USERNAME) --password-stdin + docker/push: docker push $(DOCKER_IMAGE) diff --git a/README.md b/README.md index 96cc898e64..c7175e6a28 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ python-for-android is not limited to being used with Buildozer. [![Unit tests & build apps](https://github.com/kivy/python-for-android/workflows/Unit%20tests%20&%20build%20apps/badge.svg?branch=develop)](https://github.com/kivy/python-for-android/actions?query=workflow%3A%22Unit+tests+%26+build+apps%22) [![Coverage Status](https://coveralls.io/repos/github/kivy/python-for-android/badge.svg?branch=develop&kill_cache=1)](https://coveralls.io/github/kivy/python-for-android?branch=develop) +[![Docker](https://github.com/kivy/python-for-android/actions/workflows/docker.yml/badge.svg)](https://github.com/kivy/python-for-android/actions/workflows/docker.yml) ## Documentation