Skip to content

fix: enable verbose output for Raspberry Pi image build #19

fix: enable verbose output for Raspberry Pi image build

fix: enable verbose output for Raspberry Pi image build #19

# This workflow builds a Raspberry Pi image with Docker and Bitbot pre-installed
# and uploads the bootable image as an artifact.
name: Build Bitbot Pi Image
on: [push]
# on:
# workflow_dispatch:
# push:
# branches: [ main ]
jobs:
build-pi-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Create a stage 'test-stage' instructing to add Nodesource repo and install nodejs as dependency
- name: Create custom stage for Docker
run: |
mkdir -p docker-stage/{00-packages,00-run-chroot.d}
echo docker.io > docker-stage/00-packages/01-packages
cat > docker-stage/00-run-chroot.d/02-copy-compose.sh << 'EOF'
#!/bin/bash
install -Dm644 $GITHUB_WORKSPACE/docker-compose.yml \
${ROOTFS_DIR}/home/pi/docker-compose.yml
chroot ${ROOTFS_DIR} chown pi:pi /home/pi/docker-compose.yml
chmod +x ${ROOTFS_DIR}/home/pi/docker-compose.yml
EOF
chmod +x docker-stage/00-run-chroot.d/02-copy-compose.sh
# c) Add empty 00-run.sh to ensure rootfs is created
cat > docker-stage/00-run.sh << 'EOF'
#!/bin/bash
set -e
echo "docker-stage 00-run.sh: minimal script to ensure rootfs is created"
EOF
chmod +x docker-stage/00-run.sh
- name: Build Raspberry Pi image
uses: usimd/pi-gen-action@v1
id: build
with:
image-name: bitbot-pi
hostname: bitbot
enable-ssh: 1
stage-list: stage0 stage1 stage2 docker-stage
release: bookworm
compression: zip
verbose-output: true
# increase-runner-disk-size: true
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: bitbot-pi-image
path: ${{ steps.build.outputs.image-path }}