-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- multi-platform build using buildx - push to DockerHub and update DockerHub README on push to main or tagging - use the Docker Hub registry for caching image layers to speed up builds
- Loading branch information
1 parent
f3c5bb3
commit 9d61e4d
Showing
5 changed files
with
49 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
IMAGE_NAME: kivy/buildozer | ||
# TODO: debugging | ||
# SHOULD_PUBLISH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }} | ||
SHOULD_PUBLISH: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/feature/docker_ci' || 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 }} | ||
- 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) || '' }} | ||
# TODO | ||
- 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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters