CI: deploy-job draagbaar (geen sudo-aanname, tools alleen installeren als ze ontbreken) en op label linux
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: raspberry-pi
|
# 'linux' = elke vrije runner. Geen runner-specifieke aannames in deze job (zie de
|
||||||
|
# installatiestap hieronder); valt dit ooit om, zet het dan terug op 'raspberry-pi'.
|
||||||
|
runs-on: linux
|
||||||
steps:
|
steps:
|
||||||
- name: Download build artifact
|
- name: Download build artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
@@ -51,7 +53,13 @@ jobs:
|
|||||||
PI_MAIN_USERNAME: ${{ secrets.PI_MAIN_USERNAME }}
|
PI_MAIN_USERNAME: ${{ secrets.PI_MAIN_USERNAME }}
|
||||||
PI_MAIN_ADDRESS: ${{ secrets.PI_MAIN_ADDRESS }}
|
PI_MAIN_ADDRESS: ${{ secrets.PI_MAIN_ADDRESS }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install -y sshpass
|
# Runner-onafhankelijk: werkt op elke Linux-runner (Pi of pc, arm64 of x64, host of
|
||||||
|
# container, met of zonder sudo). Tools worden alleen geinstalleerd als ze ontbreken.
|
||||||
|
SUDO=""
|
||||||
|
if [ "$(id -u)" -ne 0 ] && command -v sudo >/dev/null 2>&1; then SUDO="sudo"; fi
|
||||||
|
if ! command -v sshpass >/dev/null 2>&1 || ! command -v scp >/dev/null 2>&1; then
|
||||||
|
$SUDO apt-get update && $SUDO apt-get install -y sshpass openssh-client
|
||||||
|
fi
|
||||||
sshpass -e scp \
|
sshpass -e scp \
|
||||||
-P "$PI_MAIN_PORT" \
|
-P "$PI_MAIN_PORT" \
|
||||||
-o StrictHostKeyChecking=no \
|
-o StrictHostKeyChecking=no \
|
||||||
|
|||||||
Reference in New Issue
Block a user