From 17b22789715897e196ede0b7ff6fcc26d377e806 Mon Sep 17 00:00:00 2001 From: Era Dorta Date: Sat, 4 Jan 2025 23:52:25 +0100 Subject: [PATCH] Initial version of docker ci --- .github/workflows/docker-image.yml | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..21dddbf --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,52 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +# jobs: + +# build: + +# runs-on: ubuntu-latest + +jobs: + setup: + 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 + release: + runs-on: ubuntu-latest + needs: setup + steps: + - uses: actions/checkout@master + with: + ref: ${{ github.ref }} + # - name: Login to Docker Hub + # uses: docker/login-action@v1 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Release + # env: + # VERSION: ${{ github.event.inputs.version }} + run: | + echo "Start CI build" + uv build + SIGNALBLAST_VERSION=$(uvx hatch version) + DOCKER_TAG="${SIGNALBLAST_VERSION//+/-}" + echo "the version is $SIGNALBLAST_VERSION" + echo "the docker version is $DOCKER_TAG" + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + docker buildx create --name multibuilder + docker buildx use multibuilder + docker buildx build --build-arg SIGNALBLAST_VERSION=${SIGNALBLAST_VERSION} --platform linux/amd64,linux/arm64,linux/arm/v7 -t eradorta/signalblast:${DOCKER_TAG} -t eradorta/signalblast:latest .