Files
ebook/.gitea/workflows/deploy.yml
koziavin cecff2b795
All checks were successful
Deploy Application / deploy (push) Successful in 6s
ашч commit
2025-06-11 22:02:48 +04:00

41 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Deploy Application
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: 0406afe7de6547e850dd62c84976c6def23a5193
- name: Deploy via API
env:
GITEA_API: "https://gitea.miduway.space/api/v1/repos/levis/ebook/raw/main"
GITEA_TOKEN: "0406afe7de6547e850dd62c84976c6def23a5193"
SERVER_API: "https://ebook.miduway.space/"
run: |
# Устанавливаем зависимости без sudo
apt-get update && apt-get install -y curl
# Загружаем конфигурационные файлы
for file in docker-compose.yml Dockerfile; do
echo "Uploading $file"
curl -X PUT \
-H "Authorization: token $GITEA_TOKEN" \
-T "$file" \
"$GITEA_API/$file"
done
# Выполняем деплой на сервер с игнорированием SSL
echo "Deploying to server..."
curl -k -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"action": "deploy",
"repository": "levis/ebook",
"branch": "main"
}' \
"$SERVER_API"