(ADD) GitHub Actions workflow for deployment #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🚀 Deploy website on push | |
| on: | |
| push: | |
| branches: | |
| - main # déploie à chaque push sur la branche main | |
| jobs: | |
| web-deploy: | |
| name: 🎉 Deploy to Infomaniak | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 📦 Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: ⚙️ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 # ou 20 si ton projet utilise une version plus récente | |
| - name: 📥 Install dependencies | |
| run: npm ci | |
| - name: 🏗️ Build project | |
| run: npm run build | |
| - name: 📂 Deploy to Infomaniak via FTP | |
| uses: SamKirkland/FTP-Deploy-Action@v4.3.6 | |
| with: | |
| server: 8r863e.ftp.infomaniak.com # ton vrai hôte FTP | |
| username: ${{ secrets.FTP_USERNAME }} | |
| password: ${{ secrets.FTP_PASSWORD }} | |
| protocol: ftps | |
| local-dir: dist/ # dossier local généré par Vite | |
| server-dir: /sites/damienderyck.com/dist/ # dossier cible sur Infomaniak | |
| log-level: minimal |