Skip to content

Commit

Permalink
👷 Publish to DockerHub
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AndreMiras committed Aug 11, 2024
1 parent 27ead9a commit f526e6b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f526e6b

Please sign in to comment.