Files
landing-api/.gitea/workflows/cd.yml
T
leonm 98830c1573
ci.yml / 🧪 Tests Laravel (push) Has been cancelled
ci.yml / 🐳 Build & Push Image (push) Has been cancelled
feat: try fix cd.yml
2026-07-10 15:50:41 +02:00

48 lines
1.0 KiB
YAML

name: CD
on:
workflow_run:
workflows:
- CI
branches:
- main
types:
- completed
jobs:
deploy:
name: Déploiement production
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Configuration SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" \
> ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan \
-H "${{ secrets.DEPLOY_HOST }}" \
>> ~/.ssh/known_hosts
- name: 🚀 Deploy Docker
run: |
ssh \
-i ~/.ssh/id_ed25519 \
${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << 'EOF'
set -e
echo "Projet"
cd /data/docker/landing-api
echo "Pull nouvelle image"
docker compose pull
echo "Redémarrage"
docker compose up -d
echo "Migration Laravel"
docker compose exec -T app php artisan migrate --force
EOF