Merge remote-tracking branch 'origin/master' #3
This file contains 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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m venv serenadoit . | |
source serenadoit/bin/activate | |
pip install -r requirements.txt | |
- name: Run tests | |
run: | | |
# Ajoutez ici les commandes pour exécuter vos tests | |
deploy: | |
name: Deploy to Server | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: SSH to server and deploy | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
port: ${{ secrets.SERVER_PORT }} | |
script: | | |
cd serenadoit | |
python -m venv serenadoit . | |
source serenadoit/bin/activate | |
pip install -r requirements.txt | |
pip install gunicorn | |
git stash | |
git pull origin master | |
git stash pop | |
source serenadoit/bin/activate | |
rm -rf ~/node/static/styles/ ~/node/static/scripts/ ~/node/static/images/ | |
cp -r ./static ~/node/ | |
gunicorn -w 4 -b 0.0.0.0:10410 run_prod:app --error-logfile logs/error.log --access-logfile logs/access.log -D | |
- name: Check deployment | |
run: | | |
# Ajoutez ici les commandes pour vérifier que le déploiement s'est bien déroulé | |