Skip to content

#4 install openssh

#4 install openssh #10

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: Install Openssh
run : apt install openssh-client
- name: Add ssh keys
run: |
echo {{ secrets.PRIVATE }} > ~/.ssh/id_rsa
echo {{ secrets.PUBLIC }} > ~/.ssh/id_rsa.pub
- name: Copy file on server
run: scp -r ./.output ~
- name: Copy docker files on server
run: |
scp Dockerfile compose.yaml ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~
- name: RUN on server
run: |
ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo ${{ secrets.PASS }}| sudo -S docker compose -f \"compose.yaml\" up -d --build"
ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm -rf ~/.output"
ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm Dockerfile"
ssh ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm compose.yaml"