#3 download archive #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa -r ./.output ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~ | |
- name: Copy docker files on server | |
run: | | |
scp -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa Dockerfile compose.yaml ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~ | |
- name: RUN on server | |
run: | | |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "echo ${{ secrets.PASS }}| sudo -S docker compose -f \"compose.yaml\" up -d --build" | |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm -rf ~/.output" | |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm Dockerfile" | |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} "rm compose.yaml" |