Skip to content

Commit

Permalink
Update sync_to_dogecloud.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyunzi authored Aug 11, 2024
1 parent 16b471d commit 2778b41
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/sync_to_dogecloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ jobs:
- name: Sync files to DogeCloud
run: |
for file in $(find . -type f); do
curl -X POST "https://api.dogecloud.com/upload" \
echo "Uploading $file..."
response=$(curl -s -X POST "https://api.dogecloud.com/upload" \
-H "Authorization: Bearer ${{ secrets.ACCESS_KEY }}" \
-F "file=@$file" \
-F "key=$(basename $file)"
-F "key=$(basename $file)")
echo "Response: $response"
# Check the 'code' field in the JSON response
code=$(echo $response | jq -r '.code')
if [ "$code" != "200" ]; then
echo "Error uploading $file: $(echo $response | jq -r '.msg')"
else
echo "$file uploaded successfully."
fi
done
env:
ACCESS_KEY: ${{ secrets.ACCESS_KEY }}
Expand Down

0 comments on commit 2778b41

Please sign in to comment.