Skip to content

-d flag is added

-d flag is added #23

name: Deploy to remote server
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Set up SSH and deploy
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa 158.160.113.82 >> ~/.ssh/known_hosts
docker context create remoteContext --docker host=ssh://smirnovlad@158.160.113.82
docker-compose --context remoteContext up --build -d
env:
SSH_AUTH_SOCK: /dev/null