diff --git a/publish-container/action.yaml b/publish-container/action.yaml index daad5b6..848efeb 100644 --- a/publish-container/action.yaml +++ b/publish-container/action.yaml @@ -150,7 +150,19 @@ runs: fi git commit -m "ci(prod): deploy ${{ inputs.project }} $IMAGE_TAG" - git push origin main + + # CURSED: Retry logic from head foo + retry=0; git push || retry=1 + [ $retry = 0 ] || for i in 1 2 3; do + if [ $retry = 1 ]; then + sleep 1; retry=0 + git pull --rebase + git push || retry=1 + else + break + fi + done + [ $retry = 0 ] - name: Deploy to staging if: inputs.deploy == 'true' && github.ref_type == 'branch' && github.ref_name == 'main' && inputs.apptainer != 'true' @@ -201,4 +213,16 @@ runs: fi git commit -m "ci(staging): deploy ${{ inputs.project }} $IMAGE_TAG" - git push origin main + + # CURSED: Retry logic from head foo + retry=0; git push || retry=1 + [ $retry = 0 ] || for i in 1 2 3; do + if [ $retry = 1 ]; then + sleep 1; retry=0 + git pull --rebase + git push || retry=1 + else + break + fi + done + [ $retry = 0 ]