mirror of
https://github.com/arthur-pbty/links.git
synced 2026-08-01 20:29:27 +02:00
Ajout des fichiers de configuration pour le déploiement et la composition Docker
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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 }} "
|
||||
cd ${{ secrets.DEPLOY_PATH }} || exit 1
|
||||
git pull origin main
|
||||
docker compose up -d --build
|
||||
"
|
||||
@@ -0,0 +1,14 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
image: node:18
|
||||
working_dir: /usr/src/app
|
||||
volumes:
|
||||
- ./:/usr/src/app
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
command: sh -c "npm install && npm start"
|
||||
Reference in New Issue
Block a user