-
-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (118 loc) · 7.95 KB
/
update-files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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-rkcm3' ] || [ $miner == 'syncrobit-rkcm3' ] || [ $miner == 'bobcat-px30' ] ; 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-rkcm3' ] || [ $miner == 'syncrobit-rkcm3' ] || [ $miner == 'bobcat-px30' ] ; 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 }}