Skip to content

Commit

Permalink
Merge pull request #1646 from Screenly/fix-balena-images
Browse files Browse the repository at this point in the history
Fixes Balena disk image build
  • Loading branch information
vpetersson authored Oct 28, 2022
2 parents c1c1c21 + 429c6cd commit 97b3e43
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/build-balena-disk-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,54 +10,57 @@ jobs:
- name: Checkout
uses: actions/[email protected]

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16

- name: Install latest balena-cli
run: |
npm install \
--ignore-scripts \
-g \
[email protected]
- name: Login
run: balena login --token ${{ secrets.BALENA_TOKEN }}

- name: Get base board
run: |
# Logic for Raspberry Pi 1
if [ "${{ matrix.board }}" == 'pi1' ]; then
echo "BALENA_IMAGE=raspberry-pi" >> $GITHUB_ENV
# Logic for Raspberry Pi 2
elif [ "${{ matrix.board }}" == 'pi2' ]; then
echo "BALENA_IMAGE=raspberry-pi2" >> $GITHUB_ENV
else
elif [ "${{ matrix.board }}" == 'pi3' ]; then
echo "BALENA_IMAGE=raspberrypi3" >> $GITHUB_ENV
elif [ "${{ matrix.board }}" == 'pi4' ]; then
echo "BALENA_IMAGE=raspberrypi4-64" >> $GITHUB_ENV
fi
- name: Download image
run: |
balena os \
download "$BALENA_IMAGE" \
--output "$BALENA_IMAGE.img" \
--version default
- name: balena CLI Action - download
uses: balena-labs-research/[email protected]
with:
balena_token: ${{secrets.BALENA_TOKEN}}
balena_cli_commands: |
os download "$BALENA_IMAGE" \
--output "$BALENA_IMAGE.img" \
--version default
balena_cli_version: 13.7.1

- name: Preload image
run: |
balena preload \
"$BALENA_IMAGE.img" \
--fleet screenly_ose/screenly-ose-${{ matrix.board }} \
--commit latest
- name: balena CLI Action - preload
uses: balena-labs-research/[email protected]
with:
balena_token: ${{secrets.BALENA_TOKEN}}
balena_cli_commands: |
preload \
"$BALENA_IMAGE.img" \
--fleet screenly_ose/screenly-ose-${{ matrix.board }} \
--commit latest
balena_cli_version: 13.7.1

- name: balena CLI Action - configure
uses: balena-labs-research/[email protected]
with:
balena_token: ${{secrets.BALENA_TOKEN}}
balena_cli_commands: |
os configure \
"$BALENA_IMAGE.img" \
--config-network=ethernet \
--fleet screenly_ose/screenly-ose-${{ matrix.board }}
balena_cli_version: 13.7.1

- name: Zip image
run: |
zip -9 \
"$BALENA_IMAGE.zip" \
"$(date -I)-$BALENA_IMAGE.zip" \
"$BALENA_IMAGE.img"
- uses: actions/upload-artifact@v3
with:
name: Release file
path: "$BALENA_IMAGE.zip"
path: "*.zip"

0 comments on commit 97b3e43

Please sign in to comment.