Files
links/.github/workflows/deploy.yml
T

27 lines
692 B
YAML

name: Deploy to VM Prod
on:
push:
branches:
- main # déclenche le déploiement quand tu push sur main
jobs:
deploy:
runs-on: self-hosted # ton runner VM code-server
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 }}
if [ ! -d .git ]; then
git clone https://github.com/arthur-pbty/links .
else
git pull origin main
fi
docker compose up -d --build
"