From 04520d8a7fb3930527b5a929d5c0e2f300a163ea Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Mon, 6 Dec 2021 23:55:11 +0000 Subject: [PATCH] fix: add random sleep period Add random sleep period to work around balena API issues --- .github/workflows/push-to-prod-draft.yml | 6 ++++++ .github/workflows/push-to-prod.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/push-to-prod-draft.yml b/.github/workflows/push-to-prod-draft.yml index 5e589683..9cf44467 100644 --- a/.github/workflows/push-to-prod-draft.yml +++ b/.github/workflows/push-to-prod-draft.yml @@ -17,6 +17,8 @@ jobs: uses: actions/checkout@v2 with: ref: production + - name: Random sleep (balena API workaround) + run: sleep $[ ( $RANDOM % 180 ) + 1 ]s - name: Change i2c bus for RockPi if: matrix.sbc == 'rockpi' run: | @@ -37,6 +39,8 @@ jobs: uses: actions/checkout@v2 with: ref: production + - name: Random sleep (balena API workaround) + run: sleep $[ ( $RANDOM % 180 ) + 1 ]s - name: Balena Deploy uses: nebraltd/balena-cli-action@v12.54.5 if: success() @@ -51,6 +55,8 @@ jobs: uses: actions/checkout@v2 with: ref: production + - name: Random sleep (balena API workaround) + run: sleep $[ ( $RANDOM % 180 ) + 1 ]s - name: Balena Deploy uses: nebraltd/balena-cli-action@v12.54.5 if: success() diff --git a/.github/workflows/push-to-prod.yml b/.github/workflows/push-to-prod.yml index 4a76614e..5f343b10 100644 --- a/.github/workflows/push-to-prod.yml +++ b/.github/workflows/push-to-prod.yml @@ -18,6 +18,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Random sleep (balena API workaround) + run: sleep $[ ( $RANDOM % 180 ) + 1 ]s - name: Change i2c bus for RockPi if: matrix.sbc == 'rockpi' run: | @@ -36,6 +38,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Random sleep (balena API workaround) + run: sleep $[ ( $RANDOM % 180 ) + 1 ]s - name: Balena Deploy uses: nebraltd/balena-cli-action@v12.54.5 if: success() @@ -48,6 +52,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Random sleep (balena API workaround) + run: sleep $[ ( $RANDOM % 180 ) + 1 ]s - name: Balena Deploy uses: nebraltd/balena-cli-action@v12.54.5 if: success()