Skip to content

Commit

Permalink
feat: simplify deploy actions
Browse files Browse the repository at this point in the history
simplify deploy actions

Relates-to: #694
  • Loading branch information
shawaj committed Apr 24, 2023
1 parent ccd49d9 commit d53c277
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 356 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
variant: [nebra-indoor1, nebra-outdoor1, nebra-indoor2, nebra-outdoor2] # TODO add nebra-light2 later
sbc: [nebra-indoor1, nebra-outdoor1, nebra-indoor2, nebra-outdoor2, rak, pisces, og, sensecap, finestra, controllino, cotx, pantherx1, linxdot, linxdot-rkcm3, pycom, syncrobit, syncrobit-rkcm3, risinghf, midas]

steps:
- name: Checkout
Expand All @@ -21,6 +21,7 @@ jobs:
run: pip install -r requirements.txt

- name: Export short SHA of current commit
shell: bash
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
Expand All @@ -40,13 +41,24 @@ jobs:

- name: Generate Docker Compose
run: |
repo="helium-${{matrix.variant}}"
miner="${{ matrix.sbc }}"
repo="helium-$miner"
if [[ "$miner" == "nebra-indoor1" ]] || [[ "$miner" == "nebra-indoor2" ]] || [[ "$miner" == "nebra-outdoor1" ]] || [[ "$miner" == "nebra-outdoor2" ]] ; then
variant="$miner"
elif [[ "$miner" == "og" ]] ; then
variant="helium-fl1"
else
variant="$miner-fl1"
fi
echo "Variant: $variant"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml
python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
variant: [nebra-indoor1, nebra-outdoor1, nebra-indoor2, nebra-outdoor2] # TODO add nebra-light2 later
sbc: [nebra-indoor1, nebra-outdoor1, nebra-indoor2, nebra-outdoor2, rak, pisces, og, sensecap, finestra, controllino, cotx, pantherx1, linxdot, linxdot-rkcm3, pycom, syncrobit, syncrobit-rkcm3, risinghf, midas]

steps:
- name: Checkout
Expand All @@ -27,6 +27,7 @@ jobs:
run: pip install -r requirements.txt

- name: Export short SHA of current commit
shell: bash
run: |
FIRMWARE_SHORT_HASH=$( echo ${GITHUB_SHA:0:7} )
echo "FIRMWARE_SHORT_HASH=$FIRMWARE_SHORT_HASH" >> $GITHUB_ENV
Expand All @@ -46,13 +47,24 @@ jobs:

- name: Generate Docker Compose
run: |
repo="helium-${{matrix.variant}}"
miner="${{ matrix.sbc }}"
repo="helium-$miner"
if [[ "$miner" == "nebra-indoor1" ]] || [[ "$miner" == "nebra-indoor2" ]] || [[ "$miner" == "nebra-outdoor1" ]] || [[ "$miner" == "nebra-outdoor2" ]] ; then
variant="$miner"
elif [[ "$miner" == "og" ]] ; then
variant="helium-fl1"
else
variant="$miner-fl1"
fi
echo "Variant: $variant"
echo "REPO=$repo" >> $GITHUB_ENV
echo "Repo: $repo"
FIRMWARE_SHORT_HASH=${{ env.FIRMWARE_SHORT_HASH }}
python gen_docker_compose_by_variant.py ${{matrix.variant}} -o docker-compose.yml
python gen_docker_compose_by_variant.py "$variant" -o docker-compose.yml
- name: Balena Deploy
uses: nebraltd/[email protected]
Expand Down
172 changes: 0 additions & 172 deletions .github/workflows/push-to-prod-old-fleets-nebraos-cloud-draft.yml

This file was deleted.

Loading

0 comments on commit d53c277

Please sign in to comment.