fix: github actions

This commit is contained in:
2025-10-06 17:46:13 +02:00
parent 6a12760c99
commit 6b3e0323c5
8 changed files with 72 additions and 53 deletions
+45
View File
@@ -0,0 +1,45 @@
name: backend deploy
defaults:
run:
working-directory: projects/backend
on:
push:
branches:
- main
paths:
- "projects/backend/**"
- ".github/workflows/backend_*.yaml"
jobs:
audit:
uses: ./.github/workflows/backend_audit.yaml
quality:
uses: ./.github/workflows/backend_quality.yaml
tests:
uses: ./.github/workflows/backend_tests.yaml
needs: [audit, quality]
deploy:
name: deploy
needs: [tests]
runs-on: ubuntu-latest
steps:
- name: execute ssh command
uses: appleboy/ssh-action@v1.2.0
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /var/www/html/news.devscast.tech
git pull origin main --rebase
make deploy
curl -X POST "https://api.telegram.org/bot${{ secrets.DEVY_TOKEN }}/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "${{ secrets.DEVY_CHAT_ID }}",
"text": "news.devscast.tech : `'"$(git rev-parse --short HEAD)"'` has been deployed! 🎉",
"parse_mode": "Markdown"
}'