Deploy #79
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
# this is a workflow used to deploy the bot to a personal | |
# production server, you can use it as a reference for | |
# your own deploys | |
name: Deploy | |
on: | |
workflow_run: | |
workflows: ["Build"] | |
branches: [master] | |
types: | |
- completed | |
jobs: | |
deploy: | |
name: Deploy to production server | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Pull updated image and restart container | |
uses: appleboy/ssh-action@v0.1.7 | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
port: ${{ secrets.DEPLOY_PORT }} | |
username: ${{ secrets.DEPLOY_USER }} | |
key: ${{ secrets.DEPLOY_PRIVATE_KEY }} | |
script: | | |
cd ${{ secrets.DEPLOY_DIRECTORY }} | |
docker pull ghcr.io/liquidpl/dangobot:latest | |
docker compose down | |
docker compose up -d | |
docker rmi $(docker images -f "dangling=true" -q ghcr.io/liquidpl/dangobot) |