-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (49 loc) · 1.7 KB
/
docker-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
name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# jobs:
# build:
# runs-on: ubuntu-latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: '0'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build wheel
run: uv build
- name: Configure docker
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker buildx create --name multibuilder
docker buildx use multibuilder
- name: Set env variables
run: |
SIGNALBLAST_VERSION=$(uvx hatch version)
DOCKER_TAG="${SIGNALBLAST_VERSION//+/-}"
echo "the version is $SIGNALBLAST_VERSION"
echo "the docker version is $DOCKER_TAG"
echo "SIGNALBLAST_VERSION=$SIGNALBLAST_VERSION" >> "$GITHUB_ENV"
echo "DOCKER_TAG=$DOCKER_TAG" >> "$GITHUB_ENV"
- name: Build image
run: docker buildx build --build-arg SIGNALBLAST_VERSION=${SIGNALBLAST_VERSION} --platform linux/amd64,linux/arm64 -t eradorta/signalblast:${DOCKER_TAG} -t eradorta/signalblast:latest . --push