36 lines
1.0 KiB
YAML
36 lines
1.0 KiB
YAML
# Nom du workflow
|
|
name: Symfony CI - Install, Test, Build, Attest & Deploy
|
|
|
|
# Déclencheurs du workflow
|
|
on:
|
|
push:
|
|
branches:
|
|
- master # Ou 'main'
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
branches:
|
|
- master # Ou 'main'
|
|
|
|
# Permissions nécessaires pour les actions utilisées
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
id-token: write
|
|
attestations: write
|
|
security-events: write # Requis pour Snyk pour poster les résultats
|
|
|
|
jobs:
|
|
deploy:
|
|
name: 🚀 Deploy to Production
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Deploy with SSH & Ansible
|
|
uses: appleboy/ssh-action@v1.0.0
|
|
with:
|
|
host: ${{ secrets.SSH_HOST }}
|
|
username: ${{ secrets.SSH_USER }}
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
port: 22
|
|
script: |
|
|
cd /var/www/mainframe/app && git pull && nohup sh ./update.sh
|