diff --git a/.github/workflows/on-tag.yml b/.github/workflows/on-tag.yml index 46c255b..c587c80 100644 --- a/.github/workflows/on-tag.yml +++ b/.github/workflows/on-tag.yml @@ -19,6 +19,14 @@ jobs: runs-on: mempool-ci timeout-minutes: 120 name: Build and push to DockerHub + strategy: + max-parallel: 1 + matrix: + include: + - image: electrs + cargo_extra_args: "" + - image: electrs-liquid + cargo_extra_args: "--features liquid" steps: - name: Set env variables run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV @@ -62,7 +70,8 @@ jobs: --cache-from "type=local,src=/tmp/.buildx-cache" \ --cache-to "type=local,dest=/tmp/.buildx-cache" \ --platform linux/amd64,linux/arm64 \ - --tag ${{ secrets.DOCKER_HUB_USER }}/electrs:$TAG \ - --tag ${{ secrets.DOCKER_HUB_USER }}/electrs:latest \ + --tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.image }}:$TAG \ + --tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.image }}:latest \ --output "type=registry" . \ - --build-arg commitHash=$SHORT_SHA + --build-arg commitHash=$SHORT_SHA \ + --build-arg CARGO_EXTRA_ARGS="${{ matrix.cargo_extra_args }}" diff --git a/Dockerfile b/Dockerfile index 5448893..090bbca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,8 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y WORKDIR /build COPY . . -RUN cargo build --release --bin electrs +ARG CARGO_EXTRA_ARGS="" +RUN cargo build --release --bin electrs ${CARGO_EXTRA_ARGS} FROM base as deploy