-
-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1646 from Screenly/fix-balena-images
Fixes Balena disk image build
- Loading branch information
Showing
1 changed file
with
35 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" |