fix(deploy-container): Add retry logic to git push
This commit is contained in:
@@ -150,7 +150,19 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
git commit -m "ci(prod): deploy ${{ inputs.project }} $IMAGE_TAG"
|
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
|
- name: Deploy to staging
|
||||||
if: inputs.deploy == 'true' && github.ref_type == 'branch' && github.ref_name == 'main' && inputs.apptainer != 'true'
|
if: inputs.deploy == 'true' && github.ref_type == 'branch' && github.ref_name == 'main' && inputs.apptainer != 'true'
|
||||||
@@ -201,4 +213,16 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
git commit -m "ci(staging): deploy ${{ inputs.project }} $IMAGE_TAG"
|
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 ]
|
||||||
|
|||||||
Reference in New Issue
Block a user