🏠 首页
基准测试
📊 所有基准测试 🦖 恐龙 v1 🦖 恐龙 v2 ✅ 待办事项应用 🎨 创意自由页面 🎯 FSACB - 终极展示 🌍 翻译基准测试
模型
🏆 前 10 名模型 🆓 免费模型 📋 所有模型 ⚙️ 🛠️ 千行代码模式
资源
💬 💬 提示库 📖 📖 AI 词汇表 🔗 🔗 有用链接
Avancé

Pipeline CI/CD avec GitHub Actions

#devops #github #ci-cd #yaml

Configuration d'un fichier YAML pour automatiser les tests et le déploiement d'une application Node.js.

Fournis la configuration complète d'un workflow GitHub Actions (.github/workflows/ci.yml) pour une application Node.js. Le pipeline doit se déclencher sur chaque 'push' et 'pull request' vers la branche 'main'. Les étapes incluent : 1) Checkout du code, 2) Installation des dépendances (npm ci), 3) Exécution des tests unitaires (npm test), 4) Construction de l'application (npm run build), et 5) Déploiement simulé sur un serveur de staging. Inclus des conditions pour ne pas déployer si les tests échouent.