0.0.0 #1
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 to Server | |
on: | |
release: | |
types: [created] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create SSH key | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
host="${{ secrets.SSH_HOST_IP }}" | |
hosts="$(dig +short "$host" | grep -v '\.$' | sed -z 's|\n|,|g')$host" | |
ssh-keyscan -H "$hosts" > ~/.ssh/known_hosts | |
- name: Deploy on Remote | |
run: | | |
ssh -i ~/.ssh/id_rsa ${{ secrets.SSH_HOST_USER }}@${{ secrets.SSH_HOST_IP }} "$( cat <<'EOT' | |
screen -dRRS DestinyActivityReport | |
cd DestinyActivityReport | |
git reset --hard HEAD | |
git pull | |
sudo docker-compose up --build --detach | |
docker system prune -f | |
EOT | |
)" |