Skip to content

Commit f526e6b

Browse files
committed
👷 Publish to DockerHub
Our public DockerHub Image was 3 years old as the automatic build became a pro feature. With this change we're now publishing to DockerHub from the CI on push to the develop branch. Authentication to DockerHub is done using personal access tokens configured using `andremiras` username, but this can be updated anytime with another token refs: - https://app.docker.com/settings/personal-access-tokens - https://github.com/kivy/python-for-android/settings/secrets/actions We use a dedicated docker.yml workflow file rather than building on top of the existing push.yml one to keep things clean and separated. In the future we may add multi architecture support. Updating the public image also fixes the issue where the sh logger was too verbose leading to huge and unreadable CI logs.
1 parent 27ead9a commit f526e6b

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.github/workflows/docker.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Docker
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- develop
8+
pull_request:
9+
10+
jobs:
11+
docker:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: docker/setup-buildx-action@v3
16+
- run: make docker/build
17+
- run: make docker/login
18+
env:
19+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
20+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
21+
- name: docker push
22+
if: github.ref == 'develop'
23+
run: make docker/push

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ docker/pull:
117117
docker/build:
118118
docker build --cache-from=$(DOCKER_IMAGE) --tag=$(DOCKER_IMAGE) .
119119

120+
docker/login:
121+
@echo $(DOCKERHUB_TOKEN) | docker login --username $(DOCKERHUB_USERNAME) --password-stdin
122+
120123
docker/push:
121124
docker push $(DOCKER_IMAGE)
122125

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ python-for-android is not limited to being used with Buildozer.
4747

4848
[![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)
4949
[![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)
50+
[![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)
5051

5152
## Documentation
5253

0 commit comments

Comments
 (0)