This commit is contained in:
@ -8,11 +8,23 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: 0406afe7de6547e850dd62c84976c6def23a5193
|
||||
token: 0406afe7de6547e850dd62c84976c6def23a5193 # Используем секрет вместо явного токена
|
||||
|
||||
- name: Upload files via HTTPS API
|
||||
- name: Upload all files via API
|
||||
env:
|
||||
GITEA_API: "https://gitea.miduway.space/api/v1/repos/levis/help365/raw/help.miduway.space"
|
||||
run: |
|
||||
curl -X PUT \
|
||||
-H "Authorization: token 0406afe7de6547e850dd62c84976c6def23a5193" \
|
||||
-T ./index.html \
|
||||
"https://gitea.miduway.space/api/v1/repos/levis/help365/raw/help.miduway.space/index.html"
|
||||
# Устанавливаем зависимости
|
||||
sudo apt-get update && sudo apt-get install -y curl
|
||||
|
||||
# Загружаем все файлы рекурсивно
|
||||
find . -type f \( -name '*.html' -o -name '*.css' -o -name '*.js' -o -name '*.png' -o -name '*.jpg' \) \
|
||||
-exec sh -c '
|
||||
filepath="$1"
|
||||
remote_path="${filepath#./}"
|
||||
echo "Uploading $filepath → $remote_path"
|
||||
curl -X PUT \
|
||||
-H "Authorization: token 0406afe7de6547e850dd62c84976c6def23a5193" \
|
||||
-T "$filepath" \
|
||||
"$GITEA_API/$remote_path"
|
||||
' sh {} \;
|
||||
|
Reference in New Issue
Block a user