Fixes in docker build in CI #5
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
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@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Checkout code | |
uses: actions/checkout@master | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: '0' | |
# - name: Login to Docker Hub | |
# uses: docker/login-action@v1 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- 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 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: 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 . |