Update README.md #57
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: main | |
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 <<EOF >> ~/.ssh/config | |
Host target | |
HostName $SSH_HOST | |
User $SSH_USER | |
IdentityFile ~/.ssh/github | |
LogLevel ERROR | |
StrictHostKeyChecking no | |
EOF | |
- name: Run deploy | |
run: | | |
ssh target "cd fjob_backend/ && docker-compose down && git pull && docker-compose build && docker-compose up -d --force-recreate" |