Skip to content

Create ContinuousIntegration.yml #1

Create ContinuousIntegration.yml

Create ContinuousIntegration.yml #1

name: Continuous Integration
on:
push:
branches:
- master
concurrency:
group: master
cancel-in-progress: true
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Configure SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/github
chmod 600 ~/.ssh/github
cat >>~/.ssh/config <<END
Host target
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/github
LogLevel ERROR
StrictHostKeyChecking no
END
- name: Run deploy
run: |
ssh target "cd concertify/ && sudo docker-compose down && git pull && sudo docker-compose build && sudo docker-compose up -d --force-recreate"