Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Publish to DockerHub #1885

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docker

on:
push:
pull_request:
workflow_dispatch:

env:
IMAGE_NAME: kivy/buildozer
SHOULD_PUBLISH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) }}

jobs:
build:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: ${{ env.SHOULD_PUBLISH == 'true' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Multi-platform Image
uses: docker/build-push-action@v6
with:
push: ${{ env.SHOULD_PUBLISH == 'true' }}
tags: ${{ env.IMAGE_NAME }}:latest
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
cache-to: ${{ env.SHOULD_PUBLISH == 'true' && format('type=registry,ref={0}:latest,mode=max', env.IMAGE_NAME) || '' }}
- name: Local Build for Testing
uses: docker/build-push-action@v6
with:
# Load image into local Docker daemon
load: true
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
tags: ${{ env.IMAGE_NAME }}:latest
# Run the locally built image to test it
- name: Docker run
run: docker run ${{ env.IMAGE_NAME }} --version

update-readme:
runs-on: ubuntu-24.04
needs: build
steps:
- uses: actions/checkout@v4
- uses: peter-evans/dockerhub-description@v4
if: ${{ env.SHOULD_PUBLISH == 'true' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.IMAGE_NAME }}
readme-filepath: README.md
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ build dependencies. For more information, see
[![Android](https://github.com/kivy/buildozer/workflows/Android/badge.svg)](https://github.com/kivy/buildozer/actions?query=workflow%3AAndroid)
[![iOS](https://github.com/kivy/buildozer/workflows/iOS/badge.svg)](https://github.com/kivy/buildozer/actions?query=workflow%3AiOS)
[![Coverage Status](https://coveralls.io/repos/github/kivy/buildozer/badge.svg)](https://coveralls.io/github/kivy/buildozer)
[![Docker](https://github.com/kivy/buildozer/actions/workflows/docker.yml/badge.svg)](https://github.com/kivy/buildozer/actions/workflows/docker.yml)


## Installation
Expand Down Expand Up @@ -68,7 +69,7 @@ docker build --tag=kivy/buildozer .
For macOS, build with:

```bash
docker buildx build --platform=linux/amd64 -t kivy/buildozer .
docker buildx build --platform=linux/amd64 --tag=kivy/buildozer .
```

- Run with:
Expand All @@ -77,10 +78,6 @@ docker buildx build --platform=linux/amd64 -t kivy/buildozer .
docker run --volume "$(pwd)":/home/user/hostcwd kivy/buildozer --version
```

> [!WARNING]
> [DockerHub](https://hub.docker.com/) contains an obsolete Docker image for
> Buildozer. It is deprecated. Build your own.

### Example Build with Caching
- Build and keep downloaded SDK and NDK in `~/.buildozer` directory:

Expand All @@ -95,9 +92,6 @@ Use [ArtemSBulgakov/buildozer-action@v1](https://github.com/ArtemSBulgakov/build
to build your packages automatically on push or pull request.
See [full workflow example](https://github.com/ArtemSBulgakov/buildozer-action#full-workflow).

> [!WARNING]
> This GitHub action may use an obsolete version of Buildozer; use with caution.

## Usage

```yml
Expand Down
Loading