Skip to content

Enable nargo tagged deploys #30

Enable nargo tagged deploys

Enable nargo tagged deploys #30

Workflow file for this run

name: Build Dev Images
on:
pull_request:
jobs:
pr:
strategy:
matrix:
image: ["circom", "circomspect", "nargo", "snarkjs"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Image
run: |
docker buildx build -f images/${{ matrix.image }}/Dockerfile -t ${{ matrix.image }}:unoptimized --load images/${{ matrix.image }}/
- name: Install SlimTookit
run: |
curl -sL https://raw.githubusercontent.com/slimtoolkit/slim/master/scripts/install-slim.sh | sudo -E bash -
- name: Build Optimized Image
run: |
# Find any extra slim flags to pass when minimizing the image.
extra_slim_flags_file="./images/${{ matrix.image }}/extra-slim-flags.txt"
extra_slim_flags=()
# Check if the extra slim flags file exists
if [[ -f "$extra_slim_flags_file" ]]; then
# Read each line of the file into the array
while IFS= read -r line; do
[[ -z "$line" ]] && continue
extra_slim_flags+=($line)
done < "$extra_slim_flags_file"
echo "Running with extra slim flags: ${extra_slim_flags[@]}"
else
echo "No extra slim flags detected."
fi
slim build --target ${{ matrix.image }}:unoptimized \
--tag sindrilabs/${{ matrix.image }}:dev \
--http-probe=false \
--exclude-pattern '/tmp/*' \
--mount "./images/${{ matrix.image }}/:/sindri/" \
--exec "./test.sh" \
"${extra_slim_flags[@]}"
- name: Deploy to DockerHub
run: |
docker push sindrilabs/${{ matrix.image }}:dev