mirror of
https://github.com/arthur-pbty/syncfilm.git
synced 2026-06-03 23:36:38 +02:00
Ajouter le workflow de déploiement pour la production sur VM
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
name: Deploy to VM Prod
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Deploy to production
|
||||
run: |
|
||||
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "
|
||||
mkdir -p ${{ secrets.DEPLOY_PATH }}
|
||||
cd ${{ secrets.DEPLOY_PATH }}
|
||||
|
||||
echo '${{ secrets.ENV_FILE }}' > .env
|
||||
|
||||
if [ ! -d .git ]; then
|
||||
git clone https://github.com/arthur-pbty/syncfilm .
|
||||
else
|
||||
git pull origin main
|
||||
fi
|
||||
|
||||
docker compose up -d --build
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user