Skip to content

#4 modif conf github #7

#4 modif conf github

#4 modif conf github #7

Workflow file for this run

name: deploy
on:
push:
branches: '*'
jobs:
deplou:
runs-on: ubuntu-latest
steps:
- name: Get repo
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: latest
cache: 'npm'
- name: Installation project s packages
run: npm i
- name: build project
run: npm run build
- name: Copy file on server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASS }}
source: ./.output/*
target: ~/.output
- name: Copy docker files on server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASS }}
source: "Dockerfile, compose.yaml"
target: ~
- name: RUN on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASS }}
script: |
echo ${{ secrets.PASS }}| sudo -S docker compose -f "compose.yaml" up -d --build
rm -rf ~/.output
rm Dockerfile
rm compose.yaml