-
Notifications
You must be signed in to change notification settings - Fork 118
76 lines (66 loc) · 2.34 KB
/
wheel_image.yml
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
name: Build custom Docker image for manylinux wheels
on:
workflow_dispatch:
inputs:
base_image:
description: 'The base Docker image to use'
default: 'manylinux2014'
type: choice
options:
- 'manylinux2014'
- 'manylinux_2_28'
- 'manylinux_2_34'
upload:
description: 'Whether to upload (push) the image to the container registry'
default: 'false'
required: true
type: 'boolean'
container_registry:
description: 'The name of the container registry to upload the image to (only useful if used with upload=true)'
default: 'ghcr.io'
required: true
options:
- 'ghcr.io'
- 'docker.io'
tag:
description: 'The tag for the final Docker image'
default: 'latest'
required: true
jobs:
docker:
name: 'Create Docker image for manylinux wheels'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: 'linux/amd64'
arch: 'x86_64'
- platform: 'linux/arm64'
arch: 'aarch64'
steps:
- name: Login to Docker Hub
if: github.event.inputs.upload == 'true' && github.event.inputs.container_registry == 'docker.io'
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub container registry
if: github.event.inputs.upload == 'true' && github.event.inputs.container_registry == 'ghcr.io'
uses: docker/login-action@v3
with:
registry: 'ghcr.io'
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:packaging/python"
platforms: ${{ matrix.platform }}
push: ${{ github.event.inputs.upload }}
tags: ${{ github.event.inputs.container_registry }}/neuronsimulator/neuron_wheel:${{ github.event.inputs.tag }}-${{ matrix.arch }}
build-args: |
MANYLINUX_IMAGE=${{ github.event.inputs.base_image }}_${{ matrix.arch }}