Skip to content

#4 auto accept rsa key fingerprint #13

#4 auto accept rsa key fingerprint

#4 auto accept rsa key fingerprint #13

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