This guide explains how to use GitHub Actions for free cloud compilation of BlazeNeuro Linux, inspired by the BBR kernel compilation article.
- Free: 2000 minutes/month for private repos, unlimited for public
- Powerful: 2-core CPU, 7GB RAM, 14GB SSD
- Automated: Builds on every push
- Artifacts: Download compiled system as tarball
Uses build.yml workflow:
- Builds directly on Ubuntu 22.04 runner
- Faster setup time
- May have dependency issues
Pros: Quick, simple Cons: Less reproducible, harder to debug
Uses build-docker.yml workflow:
- Multi-stage Dockerfile
- Isolated build environment
- Reproducible builds
- Easy local testing
Pros: Reliable, reproducible, debuggable Cons: Slightly longer build time
git clone https://github.com/yourusername/BlazeNeuroLinux.git
cd BlazeNeuroLinux- Go to repository Settings
- Navigate to Actions → General
- Enable "Allow all actions and reusable workflows"
- Save
For Docker build (recommended):
# Rename to activate
mv .github/workflows/build-docker.yml .github/workflows/build.yml.bak
mv .github/workflows/build-docker.yml .github/workflows/build.ymlOr keep both and manually select which to run.
Automatic: Push to main/develop branch
git add .
git commit -m "Trigger build"
git push origin mainManual:
- Go to Actions tab
- Select workflow
- Click "Run workflow"
- Choose branch
- Click "Run workflow" button
- Go to Actions tab
- Click on running workflow
- Expand "Build complete system" step
- Watch real-time logs
- Stage 1 (Prepare): ~2 minutes
- Stage 2 (Toolchain): ~60-90 minutes
- Stage 3 (Temp System): ~20-30 minutes
- Stage 4 (Final System): ~15-20 minutes
- Stage 5 (Configure): ~30-45 minutes
Total: ~2-3 hours
- Go to completed workflow run
- Scroll to "Artifacts" section
- Download:
blazeneuro-system- Root filesystem tarball (~500MB)build-logs- Complete build logs
# Extract rootfs
mkdir blazeneuro-root
cd blazeneuro-root
tar xzf ../blazeneuro-rootfs.tar.gz
# Create bootable USB
sudo ../usb-installer/create-usb.sh /dev/sdXTest the Docker build locally before pushing:
# Build image
docker build -t blazeneuro-builder .
# Check for errors
docker build --progress=plain -t blazeneuro-builder . 2>&1 | tee build.log
# Extract artifact
docker create --name blazeneuro blazeneuro-builder
docker cp blazeneuro:/blazeneuro-rootfs.tar.gz .
docker rm blazeneuroEdit .github/workflows/build-docker.yml:
jobs:
build:
timeout-minutes: 360 # 6 hours (increase if needed)For faster builds, split stages:
jobs:
toolchain:
runs-on: ubuntu-latest
steps:
- name: Build toolchain
run: sudo ./build.sh stage2
- uses: actions/upload-artifact@v4
with:
name: toolchain
path: /mnt/lfs/tools/
system:
needs: toolchain
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: toolchain
path: /mnt/lfs/tools/
- name: Build system
run: sudo ./build.sh stage3Check logs:
- Click on failed step
- Expand error section
- Download build-logs artifact
Common fixes:
# Increase disk space
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android
sudo apt-get clean
df -h
# Add more dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential python3 m4Increase timeout or split into stages:
timeout-minutes: 480 # 8 hours- name: Free space
run: |
sudo rm -rf /opt/ghc /usr/local/share/boost
sudo docker system prune -af- Use Docker build for production
- Test locally before pushing
- Cache dependencies for faster builds
- Split large builds into stages
- Keep logs for debugging
- Verify artifacts after download
Add caching to workflow:
- name: Cache sources
uses: actions/cache@v3
with:
path: sources/
key: sources-${{ hashFiles('config/packages.list') }}
- name: Cache toolchain
uses: actions/cache@v3
with:
path: /mnt/lfs/tools/
key: toolchain-${{ hashFiles('scripts/stages/02-toolchain.sh') }}- Public repos: Unlimited minutes
- Private repos: 2000 minutes/month
- Storage: 500MB artifacts (free)
- Use caching to reduce build time
- Only build on tagged releases
- Disable unnecessary stages
on:
push:
tags:
- 'v*' # Only build on version tags| Aspect | Local Build | GitHub Actions |
|---|---|---|
| Cost | Hardware + electricity | Free (public) |
| Time | 2-3 hours | 2-3 hours |
| Resources | Your machine | 2-core, 7GB RAM |
| Automation | Manual | Automatic |
| Artifacts | Local files | Downloadable |
| Reproducibility | Variable | Consistent |
Build for multiple architectures:
strategy:
matrix:
arch: [x86_64, aarch64]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build for ${{ matrix.arch }}
run: |
docker build --platform linux/${{ matrix.arch }} \
-t blazeneuro-${{ matrix.arch }} .For issues:
- Check TROUBLESHOOTING.md
- Review workflow logs
- Test Docker build locally
- Open GitHub issue with logs