From 8dc82394d7c83e2639ae333f18cee0f3c1800ef8 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 13 Sep 2025 01:38:38 +0200 Subject: [PATCH] =?UTF-8?q?Ajouter=20le=20workflow=20de=20d=C3=A9ploiement?= =?UTF-8?q?=20pour=20la=20production=20sur=20VM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..2e321e5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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 + " + +