forked from cdrx/docker-pyinstaller
-
Notifications
You must be signed in to change notification settings - Fork 12
166 lines (153 loc) · 4.96 KB
/
docker-image-linux-ghcr.yml
File metadata and controls
166 lines (153 loc) · 4.96 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Docker Image CI Linux ghcr.io
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
tags:
- v*.*.*
branches:
- main
pull_request:
branches:
- main
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository_owner }}/pyinstaller-linux
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
uses: sigstore/cosign-installer@v4.1.0
with:
cosign-release: v2.2.4
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4.0.0
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v6.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push slim bookworm Docker image
id: build-slim-bookworm-and-push
uses: docker/build-push-action@v7.0.0
with:
context: .
file: Dockerfile-py3-linux-slim
platforms: |
linux/386
linux/amd64
linux/arm/v5
linux/arm/v7
linux/arm64/v8
linux/ppc64le
linux/s390x
push: true
build-args: PYTHON_VERSION=3.13.11-slim-bookworm
tags: |
${{ steps.meta.outputs.tags }}-slim
${{ steps.meta.outputs.tags }}-slim-bookworm
labels: |
${{ steps.meta.outputs.labels }}-slim
${{ steps.meta.outputs.labels }}-slim-bookworm
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push slim trixie Docker image
id: build-slim-trixie-and-push
uses: docker/build-push-action@v7.0.0
with:
context: .
file: Dockerfile-py3-linux-slim
platforms: |
linux/386
linux/amd64
linux/arm/v5
linux/arm/v7
linux/arm64/v8
linux/ppc64le
linux/riscv64
linux/s390x
push: true
build-args: PYTHON_VERSION=3.13.11-slim-trixie
tags: |
${{ steps.meta.outputs.tags }}-slim-trixie
labels: |
${{ steps.meta.outputs.labels }}-slim-trixie
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push bookworm Docker image
id: build-bookworm-and-push
uses: docker/build-push-action@v7.0.0
with:
context: .
file: Dockerfile-py3-linux
platforms: |
linux/386
linux/amd64
linux/arm/v5
linux/arm/v7
linux/arm64/v8
linux/ppc64le
linux/s390x
push: true
build-args: PYTHON_VERSION=3.13.11-bookworm
tags: |
${{ steps.meta.outputs.tags }}
${{ steps.meta.outputs.tags }}-bookworm
labels: |
${{ steps.meta.outputs.labels }}
${{ steps.meta.outputs.labels }}-bookworm
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push trixie Docker image
id: build-trixie-and-push
uses: docker/build-push-action@v7.0.0
with:
context: .
file: Dockerfile-py3-linux
platforms: |
linux/386
linux/amd64
linux/arm/v5
linux/arm/v7
linux/arm64/v8
linux/ppc64le
linux/riscv64
linux/s390x
push: true
build-args: PYTHON_VERSION=3.13.11-trixie
tags: |
${{ steps.meta.outputs.tags }}-trixie
labels: |
${{ steps.meta.outputs.labels }}-trixie
cache-from: type=gha
cache-to: type=gha,mode=max