Update deploy.yml #5
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 and build | |
on: | |
push: | |
branches: ["deployment-dev" ] | |
pull_request: | |
branches: ["deployment-dev" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create SSH key | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ../private.key | |
sudo chmod 600 ../private.key | |
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
- name: Connect to server | |
run: | | |
ssh -T ${{ secrets.SSH_SERVER_ADRESS }} -i ../private.key | |
pwd | |
cd nsreg-watcher | |
docker-compose -f dev.yml down | |
docker-compose -f dev.yml up --build -d | |