forked from zauberzeug/nicegui
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (71 loc) · 2.92 KB
/
_docker.yml
File metadata and controls
75 lines (71 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and Push Docker
on:
workflow_call:
inputs:
version:
description: "Version to build (e.g., 1.2.3)"
required: true
type: string
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Prepare Docker image
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
VERSION=${{ inputs.version }}
SHORTREF=${GITHUB_SHA::8}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}"
# If the VERSION looks like a version number, also tag it 'latest'
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- uses: docker/setup-qemu-action@v4
- uses: docker/login-action@v4
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/setup-buildx-action@v4
- uses: docker/build-push-action@v7
with:
context: .
file: ./release.dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ steps.prep.outputs.tags }}
build-args: VERSION=${{ steps.prep.outputs.version }}
cache-from: |
type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache-amd64
type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache-arm64
- uses: docker/build-push-action@v7
with:
context: .
file: ./release.dockerfile
platforms: linux/amd64
build-args: VERSION=${{ steps.prep.outputs.version }}
push: false
cache-from: type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache-amd64
cache-to: type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache-amd64,mode=max
- uses: docker/build-push-action@v7
with:
context: .
file: ./release.dockerfile
platforms: linux/arm64
build-args: VERSION=${{ steps.prep.outputs.version }}
push: false
cache-from: type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache-arm64
cache-to: type=registry,ref=${{ steps.prep.outputs.docker_image }}:buildcache-arm64,mode=max
- uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_PASSWORD }}
with:
destination_container_repo: zauberzeug/nicegui
provider: dockerhub
short_description: "Web Based User Interface for Python with Buttons, Dialogs, Markdown, 3D Scenes and Plots"