mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-05-06 22:12:23 +08:00
fix(nginx): panic if sbin path is empty #1178
This commit is contained in:
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
@@ -288,39 +288,15 @@ jobs:
|
||||
- name: Upload to R2
|
||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
env:
|
||||
WRANGLER_LOG: debug
|
||||
with:
|
||||
accountId: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
apiToken: ${{ secrets.CF_R2_API_TOKEN }}
|
||||
wranglerVersion: "4.21.1"
|
||||
command: |
|
||||
retry_upload() {
|
||||
local file_path="$1"
|
||||
local remote_path="$2"
|
||||
local max_attempts=3
|
||||
local attempt=1
|
||||
|
||||
while [ $attempt -le $max_attempts ]; do
|
||||
echo "Attempt $attempt of $max_attempts: Uploading $file_path to $remote_path"
|
||||
if r2 object put "$remote_path" --file "$file_path" --remote; then
|
||||
echo "Successfully uploaded $file_path on attempt $attempt"
|
||||
return 0
|
||||
else
|
||||
echo "Failed to upload $file_path on attempt $attempt"
|
||||
if [ $attempt -lt $max_attempts ]; then
|
||||
echo "Waiting 5 seconds before retry..."
|
||||
sleep 5
|
||||
fi
|
||||
attempt=$((attempt + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Failed to upload $file_path after $max_attempts attempts"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Upload files with retry
|
||||
retry_upload ./${{ env.DIST }}.tar.gz nginx-ui-dev-build/${{ env.DIST }}.tar.gz
|
||||
retry_upload ./${{ env.DIST }}.tar.gz.digest nginx-ui-dev-build/${{ env.DIST }}.tar.gz.digest
|
||||
r2 object put nginx-ui-dev-build/${{ env.DIST }}.tar.gz --file ./${{ env.DIST }}.tar.gz --remote
|
||||
r2 object put nginx-ui-dev-build/${{ env.DIST }}.tar.gz.digest --file ./${{ env.DIST }}.tar.gz.digest --remote
|
||||
|
||||
docker-build:
|
||||
if: github.event_name != 'pull_request'
|
||||
|
||||
Reference in New Issue
Block a user