Ajout de mise a jour auto serv
This commit is contained in:
parent
6ed4394dda
commit
f4414d5704
1 changed files with 38 additions and 0 deletions
38
.github/workflows/deploy.yml
vendored
Normal file
38
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
name: Deploy production (servyass)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Deploy via SSH
|
||||||
|
uses: appleboy/ssh-action@v1.0.0
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
username: yass
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
port: 22
|
||||||
|
script: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "➡️ Deploy start"
|
||||||
|
|
||||||
|
cd /var/www/projet_php
|
||||||
|
|
||||||
|
echo "➡️ Pull main"
|
||||||
|
git fetch origin main
|
||||||
|
git reset --hard origin/main
|
||||||
|
|
||||||
|
echo "➡️ Permissions"
|
||||||
|
chown -R yass:www-data /var/www/projet_php
|
||||||
|
chmod -R 775 /var/www/projet_php/templates_c
|
||||||
|
|
||||||
|
echo "➡️ Clear Smarty cache"
|
||||||
|
rm -rf /var/www/projet_php/templates_c/*
|
||||||
|
|
||||||
|
echo "✅ Deploy finished"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue