Skip to content

Update Files

Update Files #1461

Workflow file for this run

name: Update Files
on:
schedule:
- cron: "0 0 * * 0" # Run weekly at midnight Sunday
repository_dispatch:
types: [file-update]
workflow_dispatch:
jobs:
file-update-prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
- run: |
cd /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}
rm -f balena.yml
rm -f .github/workflows/*.yml
rm -f config.txt
rm -f ssh_public_keys.json
mkdir -p .github/workflows
mkdir -p workflows
miner="$(echo ${{ github.event.repository.name }} | cut -d '-' -f2-)"
echo "Repo: $miner"
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/balena.yml."$miner" -O balena.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/workflows/balena-app.yml -O .github/workflows/balena-app.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/workflows/update-action-prod.yml -O workflows/update-action-prod.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/workflows/update-action-test.yml -O workflows/update-action-test.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/workflows/update-files.yml -O .github/workflows/update-files.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/workflows/build-open-fleet.yml -O .github/workflows/build-open-fleet.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/ssh/ssh_public_keys.json -O ssh_public_keys.json
if [ $miner == 'pisces' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.pisces -O config.txt
elif [ $miner == 'pycom' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.pycom -O config.txt
elif [ $miner == 'nebra-indoor1' ] || [ $miner == 'nebra-outdoor1' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.nebra-raspi -O config.txt
elif [ $miner == 'controllino' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.controllino -O config.txt
elif [ $miner == 'sensecap' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.sensecap -O config.txt
elif [ $miner == 'cotx' ] || [ $miner == 'finestra' ] || [ $miner == 'linxdot' ] || [ $miner == 'midas' ] || [ $miner == 'pantherx1' ] || [ $miner == 'syncrobit' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.syncrobit -O config.txt
elif [ $miner == 'risinghf' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.risinghf -O config.txt
elif [ $miner == 'nebra-indoor2' ] || [ $miner == 'nebra-outdoor2' ] || [ $miner == 'linxdot-rk3566' ] || [ $miner == 'syncrobit-rkcm3' ] || [ $miner == 'bobcat-px30' ] || [ $miner == 'bobcat-rk3566' ] ; then
echo "No config.txt file needed - not RasPi based."
else
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/production/balena/config/config.txt.rak -O config.txt
fi
- name: Push updated docker compose and balena.yml files
if: success()
uses: test-room-7/action-update-file@v1
with:
branch: master
file-path: |
balena.ym*
config.*
.github/workflows/*.yml
ssh_public_keys.json
workflows/update-action*
commit-msg: Update OpenFleet core files (production)
github-token: ${{ secrets.MR_BUMP }}
file-update-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: testnet
- run: |
cd /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}
rm -f balena.yml
rm -f .github/workflows/*.yml
rm -f config.txt
rm -f ssh_public_keys.json
mkdir -p .github/workflows
mkdir -p workflows
miner="$(echo ${{ github.event.repository.name }} | cut -d '-' -f2-)"
echo "Repo: $miner"
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/balena.yml."$miner" -O balena.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/workflows/balena-app.yml -O .github/workflows/balena-app.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/workflows/update-action-prod.yml -O workflows/update-action-prod.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/workflows/update-action-test.yml -O workflows/update-action-test.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/workflows/update-files.yml -O .github/workflows/update-files.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/workflows/build-open-fleet.yml -O .github/workflows/build-open-fleet.yml
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/ssh/ssh_public_keys.json -O ssh_public_keys.json
if [ $miner == 'pisces' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.pisces -O config.txt
elif [ $miner == 'pycom' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.pycom -O config.txt
elif [ $miner == 'nebra-indoor1' ] || [ $miner == 'nebra-outdoor1' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.nebra-raspi -O config.txt
elif [ $miner == 'controllino' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.controllino -O config.txt
elif [ $miner == 'sensecap' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.sensecap -O config.txt
elif [ $miner == 'cotx' ] || [ $miner == 'finestra' ] || [ $miner == 'linxdot' ] || [ $miner == 'midas' ] || [ $miner == 'pantherx1' ] || [ $miner == 'syncrobit' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.syncrobit -O config.txt
elif [ $miner == 'risinghf' ] ; then
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.risinghf -O config.txt
elif [ $miner == 'nebra-indoor2' ] || [ $miner == 'nebra-outdoor2' ] || [ $miner == 'linxdot-rk3566' ] || [ $miner == 'syncrobit-rkcm3' ] || [ $miner == 'bobcat-px30' ] || [ $miner == 'bobcat-rk3566' ] ; then
echo "No config.txt file needed - not RasPi based."
else
wget https://raw.githubusercontent.com/NebraLtd/helium-miner-software/master/balena/config/config.txt.rak -O config.txt
fi
- name: Push updated docker compose and balena.yml files
if: success()
uses: test-room-7/action-update-file@v1
with:
branch: testnet
file-path: |
balena.ym*
config.*
.github/workflows/*.yml
ssh_public_keys.json
workflows/update-action*
commit-msg: Update OpenFleet core files (testnet)
github-token: ${{ secrets.MR_BUMP }}