Skip to content

Commit

Permalink
chore: test build for feat arm-v7
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco committed Dec 28, 2024
1 parent 5fc4d17 commit 3d749fa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/feat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Image CI

on:
push:
branches: [ "*" ]

jobs:

build:

if: "startsWith(github.event.head_commit.message, 'chore: test build for feat')"
runs-on: ubuntu-latest

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ vars.DOCKERHUB_USERNAME }}/formicaio:armv7
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ FROM rust:1 AS builder

# Install cargo-binstall, which makes it easier to install other
# cargo extensions like cargo-leptos
# Install cargo-binstall for Linux amd64/arm64
RUN export TARGET="$(uname -m)" && wget -O cargo-binstall-linux-musl.tgz https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$TARGET-unknown-linux-musl.tgz
# Install cargo-binstall for Linux amd64/arm64/armv7
RUN export TARGET="$(arch)" && if [ "$TARGET" = "armv7l" ]; then \
wget -O cargo-binstall-linux-musl.tgz https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz; \
else \
wget -O cargo-binstall-linux-musl.tgz https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$TARGET-unknown-linux-musl.tgz; \
fi

RUN tar -xvf cargo-binstall-linux-musl.tgz
RUN cp cargo-binstall /usr/local/cargo/bin

Expand Down

0 comments on commit 3d749fa

Please sign in to comment.