deploy-on-server #3
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-on-server | |
on: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_PRIVATEKEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: SSH and Redeploy | |
run: | | |
ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa ${{ secrets.USERNAME }}@${{ secrets.HOST }} ' | |
cd ~/givpower-bots/givpower-bot-optimism-production && | |
docker compose stop givpower-bot && | |
docker compose pull givpower-bot && | |
docker compose up -d givpower-bot && | |
cd ~/givpower-bots/givpower-bot-xdai-production && | |
docker compose stop givpower-bot && | |
docker compose pull givpower-bot && | |
docker compose up -d givpower-bot && | |
docker image prune -a --force | |
' |