Skip to content

Build Image

Build Image #1717

Workflow file for this run

name: Build Image
on:
repository_dispatch:
push:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Dependencies
run: |
sudo apt update
sudo apt install coreutils p7zip-full qemu-user-static
- name: Checkout CustomPiOS
uses: actions/checkout@v2
with:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS
- name: Checkout Project Repository
uses: actions/checkout@v2
with:
path: repository
submodules: true
- name: Download Raspbian Image
run: |
cd repository/src/image
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf_latest'
- name: Update CustomPiOS Paths
run: |
cd repository/src
../../CustomPiOS/src/update-custompios-paths
- name: Force apt mirror to work around intermittent mirror hiccups
run: |
echo "OCTOPI_APTMIRROR=http://mirror.us.leaseweb.net/raspbian/raspbian" > repository/src/config.local
- name: Build Image
run: |
sudo modprobe loop
cd repository/src
sudo bash -x ./build_dist
- name: Copy output
id: copy
run: |
source repository/src/config
NOW=$(date +"%Y-%m-%d-%H%M")
IMAGE=$NOW-octopi-$DIST_VERSION
cp repository/src/workspace/*.img $IMAGE.img
echo "::set-output name=image::$IMAGE"
# artifact upload will take care of zipping for us
- uses: actions/upload-artifact@v1
if: github.event_name == 'schedule'
with:
name: ${{ steps.copy.outputs.image }}
path: ${{ steps.copy.outputs.image }}.img